#include <bits/stdc++.h>
using namespace std;
int main() {
  long long MOD = 1000000007;
  long long N, M;
  cin >> N >> M;
  vector<long long> vec(M);
  for (int i = 0; i < M; i++) {
    long long x;
    cin >> x;
    vec[i] = x;
  }
  vector<long long> kaidan(N + 1);
  int j = 0;
  kaidan[0] = 1;
  if (vec[0] == 1) {
    kaidan[1] = 0;
    j++;
  } else {
    kaidan[1] = 1;
  }
  for (int i = 2; i < N + 1; i++) {
    if (vec[j] == i) {
      j++;
      kaidan[i] = 0;
      continue;
    } else {
      kaidan[i] = (kaidan[i - 1] % MOD + kaidan[i - 2] % MOD) % MOD;
    }
  }
  cout << kaidan[N] % MOD << endl;
}
