#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> x(n + 1, true);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    x.at(a) = false;
  }
  vector<long long> v(n + 1);
  v.at(0) = 1;
  if (x.at(1))
    v.at(1) = 1;
  else
    v.at(1) = 0;
  for (int i = 2; i < n + 1; i++) {
    if (x.at(i))
      v.at(i) = v.at(i - 1) + v.at(i - 2);
    else
      v.at(i) = 0;
  }
  cout << v.at(n) << endl;
}
