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