#include <bits/stdc++.h>
using namespace std;
int n, m;
long long;
int f[100001], ans = 1;
int a[100001];
int fib(int x) {
  if (x == 0) return 0;
  if (x == 1) return 1;
  if (f[x] != 0) return f[x];
  return f[x] = fib(x - 1) + fib(x - 2);
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i <= m; i++) {
    if (i == 0)
      ans *= fib(a[i]);
    else if (i == m) {
      ans *= fib(n - a[i - 1]);
    } else {
      ans *= fib(a[i] - a[i - 1]);
    }
  }
  cout << ans << endl;
  return 0;
}
