#include <bits/stdc++.h>
using ll = long long;
using namespace std;
constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<bool> ok(n + 1, true);
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    ok[a] = false;
  }
  vector<ll> dp(n + 1);
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    if (ok[i + 1]) {
      dp[i + 1] += dp[i];
      dp[i + 1] %= MOD_LL;
    }
    if (ok[i + 2]) {
      dp[i + 2] += dp[i];
      dp[i + 2] %= MOD_LL;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
