#include <bits/stdc++.h>
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
using namespace std;
void solve() {
  long long mod = 1000000007;
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) cin >> a[i];
  vector<long long> s(N + 1);
  s[0] = 1;
  s[1] = 1;
  long long ai = 0;
  for (long long i = 2; i <= N; ++i) {
    if (ai < M && a[ai] == i) {
      s[i] = 0;
      ++ai;
    } else {
      s[i] = (s[i - 1] + s[i - 2]) % mod;
    }
  }
  cout << s[N] << endl;
}
signed main() { solve(); }
