#include <bits/stdc++.h>
using namespace std;
vector<int> a;
vector<bool> isok;
int main(void) {
  int n, m;
  cin >> n >> m;
  a.resize(m);
  isok.assign(n + 1, true);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    isok[a[i]] = false;
  }
  int dp[100010];
  dp[0] = 1;
  if (isok[1]) dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (isok[i - 2]) dp[i] += dp[i - 2];
    if (isok[i - 1]) dp[i] += dp[i - 1];
  }
  cout << dp[n] << endl;
  return 0;
}
