#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e5;
const long long P = 1e9 + 7;
int N, M, A[Nmax];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) cin >> A[i];
  vector<long long> dp(N + 1);
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (*lower_bound(A, A + M, i + 1) == i + 1) {
      dp[i + 1] = 0;
    } else {
      dp[i + 1] = (dp[i] + dp[i - 1]) % P;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
