#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int M;
  cin >> N;
  N += 1;
  cin >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<long long> p(N);
  p.at(0) = 0;
  int point = 0;
  for (int s = 0; s < N; s++) {
    if (point < M && a.at(point) == s) {
      point += 1;
      p.at(s) = 0;
    } else if (s == 0) {
      p.at(s) = 1;
    } else if (s == 1) {
      p.at(s) = p.at(s - 1);
    } else {
      p.at(s) = p.at(s - 1) + p.at(s - 2);
    }
  }
  long waru = pow(10, 9) + 7;
  cout << p.at(N - 1) % waru;
}
