#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
long steps[10001];
long count_steps(const vector<long>& as, int n) {
  int j = 0;
  steps[0] = 1;
  steps[1] = 1;
  for (int i = 1; i <= n; ++i) {
    if (j < as.size() && i == as[j]) {
      steps[i] = 0;
      ++j;
      continue;
    }
    if (i < 1) {
      continue;
    }
    steps[i] = (steps[i - 1] + steps[i - 2]) % 1000000007;
  }
  return steps[n];
}
int main(int argc, char* argv[]) {
  int n, m;
  cin >> n >> m;
  std::vector<long> as(m);
  for (int i = 0; i < m; ++i) {
    cin >> as[i];
  }
  cout << count_steps(as, n);
  return 0;
}
