#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  cin >> n >> m;
  vector<int> dp(n + 1, 0);
  map<int, bool> a;
  for (int i = 0; i < m; ++i) {
    cin >> c;
    a[c] = true;
  }
  dp[0] = 1;
  for (int i = 0; i <= n; ++i) {
    if (i + 2 <= n && !a[i + 2]) dp[i + 2] += dp[i];
    if (i + 1 <= n && !a[i + 1]) dp[i + 1] += dp[i];
  }
  cout << dp[n];
}
