#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int main() {
  int n, m, x;
  cin >> n >> m;
  set<int> a;
  for (int i = 0; i < (m); i++) {
    cin >> x;
    a.insert(x);
  }
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  for (int i = 0; i < (n); i++) {
    if (a.count(i + 1) > 0)
      dp[i + 1] = 0;
    else if (i > 0)
      dp[i + 1] = dp[i] + dp[i - 1];
    else
      dp[i + 1] = dp[i];
  }
  cout << dp[n] << endl;
  return 0;
}
