#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> A(M);
  ll before = -1;
  for (ll i = 0; i < M; i++) {
    ll a;
    cin >> a;
    if (a == before + 1) {
      cout << 0 << endl;
      return 0;
    }
    A[i] = a;
  }
  reverse(begin(A), end(A));
  vector<ll> dp(N + 1);
  constexpr ll mod = 1000000007;
  dp[0] = 1;
  for (ll i = 0; i < N; i++) {
    if (i == A.back()) {
      A.pop_back();
      continue;
    }
    dp[i + 1] += dp[i];
    dp[i + 1] %= mod;
    if (i < N - 1) {
      dp[i + 2] += dp[i];
      dp[i + 2] %= mod;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
