#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> col(N + 1, true);
  long long dp[N + 1];
  for (int i = 0; i < M; ++i) {
    int b;
    cin >> b;
    col[b] = false;
  }
  dp[0] = 1;
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j <= min(N, i + 2); ++j) {
      if (col[j]) {
        dp[j] += dp[i];
        dp[j] %= 1000000007;
      }
    }
  }
  cout << dp[N] << endl;
  return 0;
}
