#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.at(0) = 1;
  int64_t cnt = 0;
  for (int64_t i = 1; i <= N; ++i) {
    if (i == a.at(cnt)) {
      dp.at(i) = 0;
      cnt = min(cnt + 1, M - 1);
      continue;
    } else {
      if (i - 2 < 0) {
        dp.at(i) = dp.at(i - 1);
      } else {
        dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % MOD;
      }
    }
  }
  cout << dp.at(N) << endl;
  return 0;
}
