#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const long long MOD = 1000000007;
const int MAX = 510000;
int main() {
  long long N, M;
  cin >> N >> M;
  set<long long> a;
  for (long long i = 0; i < M; i++) {
    long long num;
    cin >> num;
    num--;
    a.insert(num);
  }
  vector<long long> dp(N, 0);
  if (a.count(0) && a.count(1))
    cout << 0 << endl;
  else if (a.count(0)) {
    dp[0] = 0;
    dp[1] = 1;
  } else if (a.count(1)) {
    dp[0] = 1;
    dp[1] = 0;
  } else {
    dp[0] = 1;
    dp[1] = 2;
  }
  for (long long i = 2; i < N; i++) {
    if (a.count(i))
      dp[i] = 0;
    else {
      dp[i] = dp[i - 1] % MOD + dp[i - 2] % MOD;
      dp[i] %= MOD;
    }
  }
  cout << dp[N - 1] % MOD << endl;
  return 0;
}
