#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = static_cast<ll>(1e9 + 7);
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> A(M);
  for (auto &a : A) cin >> a;
  vector<ll> DP(N + 1, 0);
  for (auto a : A) DP[a] = -1;
  DP[0] = 1;
  if (DP[1] != -1) DP[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (DP[i] == -1) continue;
    if (DP[i - 2] != -1) DP[i] += DP[i - 2];
    if (DP[i - 1] != -1) DP[i] += DP[i - 1];
  }
  cout << DP[N] % MOD << endl;
}
