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