#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e+9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  vector<long long> dp(N + 1);
  dp[0] = 1;
  int idx;
  if (a[0] == 1) {
    dp[1] = 0;
    idx = 1;
  } else {
    dp[1] = 1;
    idx = 0;
  }
  for (int i = 2; i <= N; ++i) {
    if (i == a[idx]) {
      dp[i] = 0;
      ++idx;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
