#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 9223372036854775807;
const ll mod = 1000000007;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> St(M);
  for (ll i = 0; i < M; i++) cin >> St[i];
  if (M == 0) St = {10010};
  ll j = 0;
  vector<ll> dp(100100, 0);
  dp[0] = 1;
  dp[1] = 1;
  for (ll i = 0; i < N; i++) {
    if (i == St[j] - 1) {
      dp[i] = 0;
      j++;
    }
    dp[i + 1] += dp[i] % mod;
    dp[i + 2] += dp[i] % mod;
  }
  cout << dp[N - 1] % mod << endl;
}
