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