#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e+09 + 7;
int main() {
  int64_t N, M;
  cin >> N >> M;
  vector<int64_t> a(M);
  for (int64_t i = 0; i < M; ++i) {
    cin >> a.at(i);
  }
  vector<int64_t> dp(N + 1, 0);
  dp[0] = 1;
  int64_t cnt = 0;
  for (int64_t i = 1; i <= N; ++i) {
    if (i == a.at(cnt)) {
      dp[i] = 0;
      cnt = min(cnt + 1, M - 1);
      continue;
    }
    if (i - 2 < 0) {
      dp[i] = dp[i - 1];
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
