#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> dp;
vector<bool> broke;
int dfs(int pos) {
  int& res = dp[pos];
  if (res >= 0) return res;
  if (broke[pos]) return res = 0;
  return res = dfs(pos + 1) + dfs(pos + 2);
}
int main() {
  int M;
  cin >> N >> M;
  dp.resize(N + 1, -1);
  broke.resize(N + 1, false);
  for (int i = 0; i < N; i++) {
    int t;
    cin >> t;
    broke[t] = true;
  }
  cout << dfs(0) << endl;
}
