#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<long long> dp(N + 1, 0);
  int a_idx = 0;
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (a_idx < M and a[a_idx] == i) {
      dp[i] = 0;
      a_idx++;
      continue;
    }
    if (i == 1) dp[i] = 1;
    dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
  }
  cout << dp[N] << endl;
  return 0;
}
