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