#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
void solve(long long N, long long M, std::vector<long long> a) {
  long long dp[N + 2];
  dp[0] = 1;
  for (long long i = 1; i < N + 1; i++) {
    if (find(a.begin(), a.end(), i) != a.end()) {
      dp[i] = 0;
    } else {
      if (i >= 2) {
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
      } else {
        dp[i] = dp[i - 1];
      }
    }
  }
  cout << dp[N] << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  long long M;
  scanf("%lld", &M);
  std::vector<long long> a(M);
  for (int i = 0; i < M; i++) {
    scanf("%lld", &a[i]);
  }
  solve(N, M, std::move(a));
  return 0;
}
