#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[100010];
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  long long cnt[100010];
  cnt[0] = 1;
  if (a[0] == 1)
    cnt[1] = 0;
  else
    cnt[1] = 1;
  int j = 0;
  for (int i = 2; i <= n; i++) {
    while (a[j] < i && j < m - 1) j++;
    if (a[j] == i)
      cnt[i] = 0;
    else
      cnt[i] = cnt[i - 1] + cnt[i - 2];
  }
  cout << cnt[n] << endl;
}
