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