#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  vector<long long> dp(N + 1, 0);
  for (int i = 0; i < (int)(M); i++) dp[a[i]] = 0;
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    bool can = true;
    for (int j = 0; j < M; j++) {
      if (i == a[j]) {
        can = false;
        break;
      }
    }
    if (can) {
      dp[i] += dp[i - 1];
      if (i > 1) {
        dp[i] += dp[i - 2];
      }
    }
  }
  cout << dp[N] << endl;
}
