#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long N, M;
long long a[100100];
long long dp[100100];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  bool b[100100];
  for (int j = 0; j < M; ++j) {
    int v = a[j];
    b[v] = true;
  }
  dp[0] = 1;
  for (int i = 0; i < 100100; ++i) {
    if (b[i]) {
      continue;
    }
    dp[i + 1] += dp[i];
    dp[i + 1] %= MOD;
    dp[i + 2] += dp[i];
    dp[i + 2] %= MOD;
  }
  cout << dp[N] % MOD << endl;
  return 0;
}
