#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> dp(1000000);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    dp[a[i]] = 88;
  }
  dp[0] = 1;
  if (a[0] != 1) {
    dp[1] = 1;
  } else {
    dp[1] = 0;
  }
  for (int i = 1; i < n; i++) {
    if (dp[i + 1] != 88) {
      dp[i + 1] = dp[i] + dp[i - 1];
    } else {
      dp[i + 1] = 0;
    }
  }
  cout << dp[n] << endl;
}
