#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long N, M, mod = 1000000007;
  cin >> N >> M;
  bool imp = false;
  vector<long long> fvec(N + 1);
  fvec[0] = 1;
  fvec[1] = 1;
  if (M == 0) {
    for (long long i = 1; i <= N; ++i)
      fvec[i] = (fvec[i - 1] + fvec[i - 2]) % mod;
    cout << fvec[N] << endl;
  } else {
    vector<long long> avec(M);
    cin >> avec[0];
    for (long long i = 1; i < M; ++i) {
      cin >> avec[i];
      if (avec[i] - avec[i - 1] == 1) {
        imp = true;
        break;
      }
    }
    if (imp)
      cout << 0 << endl;
    else {
      long long bpos = 0;
      for (long long i = 1; i <= N; ++i) {
        if (i == avec[bpos]) {
          fvec[i] = 0;
          bpos++;
        } else {
          if (i > 1) fvec[i] = (fvec[i - 1] + fvec[i - 2]) % mod;
        }
      }
      cout << fvec[N] << endl;
    }
  }
  return 0;
}
