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