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