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