#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1e9 + 7;
int main() {
  long long int N;
  long long int M;
  cin >> N >> M;
  vector<long long int> a(M);
  for (long long int i = 0; i < M; i++) cin >> a[i];
  vector<long long int> DP(N + 1);
  if (M == 0) {
    DP[0] = 1;
    DP[1] = 1;
    for (long long int i = 0; i < N - 1; i++) DP[i + 2] = DP[i] + DP[i + 1];
  } else {
    DP[0] = 1;
    auto it = a.begin();
    if (*it != 1) {
      DP[1] = 1;
    } else if (it + 1 != a.end())
      it++;
    for (long long int i = 0; i < N - 1; i++) {
      DP[i + 2] = DP[i + 1] + DP[i];
      if (*it == i + 2) {
        DP[i + 2] = 0;
        if (it + 1 != a.end()) it++;
      }
      DP[i + 2] %= MOD;
    }
  }
  cout << DP[N];
}
