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