#include <bits/stdc++.h>
using namespace std;
const long long MOD = 10e9 + 7;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> dp(N + 1, 0);
  vector<bool> ch(N + 1, true);
  for (int i = 0; i < (int)(M); i++) {
    long long a;
    cin >> a;
    ch[a] = false;
  }
  dp[0] = 1;
  if (ch[1]) dp[1] = dp[0];
  if (ch[2]) dp[2] = dp[0] + dp[1];
  for (long long i = 3; i <= N; i++) {
    if (ch[i]) dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  cout << dp[N] << endl;
}
