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