#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18 + 1;
const ll MOD = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<ll> a(M);
  for (int i = 0; i < M; i++) cin >> a[i];
  vector<ll> dp(N + 1, 0);
  dp[0] = 1;
  for (int i = 0; i <= N; i++) {
    bool f = true;
    for (auto e : a)
      if (i == e) f = false;
    if (f) {
      if (i - 1 >= 0) dp[i] += dp[i - 1], dp[i] %= MOD;
      if (i - 2 >= 0) dp[i] += dp[i - 2], dp[i] %= MOD;
    }
  }
  cout << dp[N] % MOD << endl;
  return 0;
}
