#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  vector<long long> ans(N + 1);
  ans[0] = 1;
  ans[1] = 1;
  int breakFind = 0;
  if (a[0] == 1) {
    ans[1] = 0;
    breakFind++;
  }
  for (int i = 2; i <= N; i++) {
    bool isbreak = false;
    while (a[breakFind] <= i) {
      if (a[breakFind] == i) {
        isbreak = true;
      }
      breakFind++;
    }
    ans[i] = (ans[i - 1] + ans[i - 2]) % MOD;
    if (isbreak) {
      ans[i] = 0;
    }
  }
  cout << ans[N] << endl;
  return 0;
}
