#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, M;
  cin >> N >> M;
  vector<long> flag(N + 1, 0);
  long a = 0;
  for (long i = 0; i < M; i++) {
    cin >> a;
    flag[a]++;
  }
  vector<long long> dp(N + 1, 0);
  dp[1] = 1;
  dp[2] = 2;
  if (flag[1]) {
    dp[1]--;
    dp[2]--;
  }
  if (flag[2]) {
    dp[2] = 0;
  }
  for (long j = 3; j <= N; j++) {
    if (flag[j]) {
      continue;
    } else {
      dp[j] = dp[j - 1] + dp[j - 2];
    }
  }
  cout << dp[N] % 1000000007 << endl;
  return 0;
}
