#include <bits/stdc++.h>
using namespace std;
long long dp[110000];
int main() {
  bool C[110000];
  int N, M;
  int a;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a;
    C[a]++;
  }
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (C[i]) continue;
    dp[i + 1] += dp[i];
    dp[i + 2] += dp[i];
  }
  cout << dp[N] << endl;
}
