#include <bits/stdc++.h>
using namespace std;
using Pll = pair<long long, long long>;
const long long MOD = 1e9 + 7;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A[i];
  }
  long long idx = 0;
  vector<long long> dp(N + 10);
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (*lower_bound(A.begin(), A.end(), i + 1) == i + 1) {
      ;
    } else {
      dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
    }
    if (*lower_bound(A.begin(), A.end(), i + 2) == i + 2)
      ;
    else
      dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
