#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (int i = 0; i < M; i++) cin >> a[i];
  long long step[100010] = {};
  step[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (i == 1) {
      if (M > 0) {
        if (a[0] != 1) {
          step[i] = step[0];
        }
      } else {
        step[i] = step[0];
      }
    } else if (find(a.begin(), a.end(), i) == a.end()) {
      step[i] = (step[i - 1] + step[i - 2]) % MOD;
    }
  }
  cout << step[N] << endl;
}
