#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> dp(N + 1, 0);
  long long mod = 1e9 + 7;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    dp[a] = -1;
  }
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (dp[i] == -1) continue;
    if (i + 1 <= N && dp[i + 1] != -1) {
      dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
    }
    if (i + 1 <= N && dp[i + 2] != -1) {
      dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
    }
  }
  cout << dp[N] << endl;
}
