#include <bits/stdc++.h>
using namespace std;
const int MAX = 100100;
int N, M;
bool A[MAX] = {0};
long int dp[MAX] = {0};
void solve() {
  cin >> N >> M;
  int a;
  for (int n = 0; n < N + 1; n++) A[n] = true;
  for (int m = 0; m < M; m++) {
    cin >> a;
    A[a] = false;
  }
  dp[0] = 1;
  if (A[1]) dp[1] = 1;
  for (int n = 2; n <= N; n++) {
    if (A[n]) dp[n] = dp[n - 1] + dp[n - 2];
  }
  cout << dp[N] << endl;
}
int main() {
  solve();
  return 0;
}
