#include <bits/stdc++.h>
using namespace std;
const long long mei = (long long)1e9 + 7;
int main() {
  long long n, m, a;
  cin >> n >> m;
  vector<long long> c(m), t(n + 1, 0);
  t[0] = 1;
  for (long long i = 0; i < (long long)(m); i++) cin >> c[i];
  a = 0;
  if (c[0] == 1)
    a++;
  else
    t[1] = 1;
  for (long long i = 2; i < (long long)(n + 1); i++) {
    if (c[a] == i) {
      a++;
      continue;
    }
    t[i] = t[i - 1] + t[i - 2];
  }
  cout << t[n];
  cout << endl;
}
