#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
int main() {
  ll N, M;
  cin >> N >> M;
  ll a[M];
  for (ll i = 0; i < M; i++) cin >> a[i];
  ll dp[N + 1];
  dp[0] = 1;
  dp[1] = 1;
  ll m = 0;
  for (ll i = 2; i <= N; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    if (a[m] == i) {
      dp[i] = 0;
      m++;
    }
  }
  cout << dp[N] << endl;
}
