#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> hakai(n, 1);
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    hakai[a - 1] = 0;
  }
  vector<long long> dp(n, 0);
  dp[0] = 1;
  for (long long i = 1; i < n; i++) {
    if (hakai[i]) {
      if (i == 1)
        dp[1] = 2;
      else
        dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[n - 1] << endl;
}
