#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, M;
  cin >> N >> M;
  vector<long> steps(N + 1, -1);
  vector<int> broken(M);
  steps[0] = 1;
  for (int i = 0; i < M; i++) {
    cin >> broken[i];
  }
  for (int i : broken) {
    steps[i] = 0;
  }
  if (steps[1] != 0) {
    steps[1] = 1;
  }
  for (int i = 2; i < N + 1; i++) {
    if (steps[i] != 0) {
      steps[i] = steps[i - 2] + steps[i - 1];
    }
  }
  cout << steps[N] % 1000000007 << endl;
  return 0;
}
