#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> dp(N+1, 0);
  vector<int> broken(M);
  for (int i = 0; i < M; i++) cin >> broken[i];
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    bool can = true;
    bool can1 = true;
    bool can2 = true;
    for (int j = 0; j < M; j++) {
      if (broken[j] == i-2) can2 = false;
      if (broken[j] == i-1) can1 = false;
      if (broken[j] == i) can = false;
    }
    if (can) {
      if (can1) dp[i] += dp[i-1];
      if (can2) dp[i] += dp[i-2];
    }
  }
  cout << dp[N]%1000000007 << endl;
}
