#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
const ll MOD = 1000000007;
const ll MOD9 = 998244353;
const int inf = 1e9;
const ll INF = 4e18;
const ll dy[4] = {1, 0, -1, 0};
const ll dx[4] = {0, -1, 0, 1};
int main() {
  ll N;
  ll M;
  cin >> N >> M;
  vl vec(N + 1);
  for (ll i = 0; i < N + 1; i++) {
    ll a;
    cin >> a;
    vec.at(a) = 1;
  }
  ll dp[N + 2];
  dp[0] = 1;
  if (vec.at(1) == 1) {
    dp[1] = 0;
  } else {
    dp[1] = 1;
  }
  for (ll i = (2); i < (N + 1); i++) {
    if (vec.at(i)) {
      dp[i] = 0;
      continue;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
}
