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