#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int N, M;
vector<int> a;
vector<long long> dp;
void solve() {
  cin >> N >> M;
  a.resize(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  dp.resize(N + 1);
  dp[0] = 1;
  int cur = 0;
  if (N > 1) dp[1] = 1;
  if (a.size() != 0) {
    if (a[0] != 1)
      dp[1] = 1;
    else {
      dp[1] = 0;
      cur++;
    }
  }
  for (long long i = 2; i <= N; i++) {
    if (cur < M && i == a[cur]) {
      dp[i] = 0;
      cur++;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[N] % MOD << '\n';
  return;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
