#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long modinv(long long a, long long m = MOD) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
const int MAXN = 100001;
long long dp[MAXN];
int main() {
  memset(dp, -1, MAXN + 1);
  int N, M;
  cin >> N >> M;
  const int MAXM = 100000;
  int A[MAXM];
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 0; i < M; i++) {
    cin >> A[i];
    dp[A[i]] = 0;
  }
  for (int i = 2; i <= N; i++) {
    if (dp[i] != 0) dp[i] = ((dp[i - 1] % MOD) + (dp[i - 2] % MOD)) % MOD;
    dp[i] %= MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
