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