#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
int INF = 1 << 30;
long long INFL = 1LL << 60;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> h(1000000);
  vector<long long> dp(1000000, 0);
  vector<long long> ok(1000000, 1);
  for (long long i = 0; i < (M); i++) cin >> h[i];
  for (long long i = 0; i < (M); i++) {
    ok[h[i]] = 0;
  }
  dp[0] = 1;
  for (int i = 0; i <= N; i++) {
    if (ok[i + 1]) dp[i + 1] += dp[i];
    if (ok[i + 2]) dp[i + 2] += dp[i];
  }
  cout << dp[N] % 1000000007 << endl;
}
