#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<bool> issafe;
int a[100010];
int main() {
  cin >> N >> M;
  long long DP[N + 1];
  issafe.assign(N + 1, true);
  for (int i = 0; i < M; ++i) {
    int a;
    cin >> a;
    issafe[a] = false;
  }
  DP[0] = 1;
  if (issafe[1]) DP[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (issafe[i])
      DP[i] = DP[i - 1] + DP[i - 2];
    else
      DP[i] = 0;
  }
  cout << DP[N] << endl;
}
