#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long a[m], dp[n + 1];
  for (long long i = 0; i < m; i++) cin >> a[i];
  dp[0] = 1;
  sort(a, a + m);
  if (binary_search(a, a + m, 1))
    dp[1] = 0;
  else
    dp[1] = 1;
  for (long long i = 2; i < n + 1; i++) {
    if (binary_search(a, a + m, i))
      dp[i] = 0;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[n];
  return 0;
}
