#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> breakstair(M);
  int sol[N + 1];
  for (int i = 0; i < M; i++) {
    int k;
    cin >> k;
    breakstair.push_back(k);
  }
  auto itr1 = find(breakstair.begin(), breakstair.end(), 1);
  auto itr2 = find(breakstair.begin(), breakstair.end(), 2);
  if (itr1 != breakstair.end()) {
    sol[1] = 0;
    if (itr2 != breakstair.end()) {
      sol[2] = 0;
    } else {
      sol[2] = 1;
    }
  } else if (itr2 != breakstair.end()) {
    sol[1] = 1;
    sol[2] = 0;
  } else {
    sol[1] = 1;
    sol[2] = 2;
  }
  for (int i = 3; i <= N; i++) {
    auto itri = find(breakstair.begin(), breakstair.end(), i);
    if (itri != breakstair.end()) {
      sol[i] = 0;
    } else {
      sol[i] = sol[i - 1] + sol[i - 2];
    }
  }
  cout << sol[N] << endl;
}
