#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  long long mod = 1e9 + 7;
  cin >> N >> M;
  vector<long long> hole(N, 0);
  for (long long i = 0; i < M; ++i) {
    long long a;
    cin >> a;
    hole[a] = 1;
  }
  long long dp[N + 10];
  fill(dp, dp + N + 10, 0);
  dp[0] = 1;
  for (long long i = 0; i < N + 5; ++i) {
    if (!hole[i + 1]) dp[i + 1] += dp[i] % mod;
    if (!hole[i + 2]) dp[i + 2] += dp[i] % mod;
    dp[i + 1] %= mod;
    dp[i + 2] %= mod;
  }
  cout << dp[N] % mod << endl;
}
