#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using Graph = vector<vector<int>>;
using Edge = map<pair<int, int>, int>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> A(M);
  vector<long long> dp(N + 1, 0);
  for (long long i = 0; i < (long long)(M); ++i) {
    cin >> A[i];
  }
  long long now = 0;
  dp[0] = 1;
  for (long long i = 1; i <= N; i++) {
    if (i == A[now]) {
      dp[i] = 0;
      now++;
      continue;
    }
    if (i == 1) {
      dp[1] = 1;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
