#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> ok(n + 1, true);
  for (int i = 0; i < (m); i++) {
    int a;
    cin >> a;
    ok[a] = false;
  }
  vector<int> F(n + 1);
  F[0] = 1;
  F[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!ok[i]) {
      F[i] = 0;
      continue;
    }
    F[i] = F[i - 1] + F[i - 2];
  }
  cout << F[n] << endl;
}
