#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N, M, ans;
  scanf("%lld %lld", &N, &M);
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) scanf("%lld", &a.at(i));
  vector<long long> dp(N + 1);
  dp.at(0) = 1;
  if (a.at(0) == 1)
    dp.at(1) = 0;
  else
    dp.at(1) == 1;
  int brokenFlag;
  for (long long i = 2; i < N + 1; i++) {
    brokenFlag = 1;
    for (auto &u : a) {
      if (i == u) brokenFlag = 0;
    }
    if (brokenFlag) {
      dp.at(i) = dp.at(i - 1) + dp.at(i - 2);
      dp.at(i) = dp.at(i) % 1000000007;
    } else {
      dp.at(i) = 0;
    }
  }
  printf("%lld\n", dp.at(N));
  return 0;
}
