#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using vll = vector<long long>;
using vpii = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using vvb = vector<vector<bool>>;
using pii = pair<int, int>;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = INT_MAX;
const int MOD = 1000000007;
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int main() {
  int N, M;
  cin >> N >> M;
  vb a(M + 1, false);
  for (int i = 0; i < (int)(M); i++) {
    int x;
    cin >> x;
    a[x] = true;
  }
  vll dp(N + 1);
  dp[0] = 1;
  dp[1] = (a[1] ? 0 : 1);
  for (int i = (int)(1); i <= (int)(N); i++) {
    if (a[i]) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 2] + dp[i - 1];
    }
  }
  cout << dp[N] << endl;
}
