#include <bits/stdc++.h>
using namespace std;
const int MOD = int(1e9) + 7;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  size_t N, M;
  cin >> N >> M;
  vector<bool> bad(N + 1);
  for (size_t i = 0; i < M; ++i) {
    int a;
    cin >> a;
    bad[a] = true;
  }
  vector<int64_t> dp(N);
  dp[0] = 1;
  for (size_t i = 1; i <= N; ++i) {
    if (bad[i]) {
      continue;
    } else {
      if (i == 1) {
        dp[i] = dp[0];
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
        dp[i] %= MOD;
      }
    }
  }
  cout << dp[N] << "\n";
  return 0;
}
