#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
    a.at(i)--;
  }
  vector<int> b(N);
  b.at(0) = 1;
  b.at(1) = 2;
  bool flaga = false;
  for (int i = 0; i < M; i++) {
    if (a.at(i) == 0) {
      flaga = true;
    }
  }
  bool flagb = false;
  for (int i = 0; i < M; i++) {
    if (a.at(i) == 1) {
      flagb = true;
    }
  }
  if (flaga) {
    b.at(0) = 0;
    b.at(1) = 1;
  }
  if (flagb) {
    b.at(1) = 0;
  }
  for (int j = 2; j < N; j++) {
    bool flag = false;
    for (int i = 0; i < M; i++) {
      if (a.at(i) == j) {
        flag = true;
      }
    }
    if (flag) {
      b.at(j) = 0;
    } else {
      b.at(j) = b.at(j - 1) + b.at(j - 2);
    }
  }
  cout << b.at(N - 1) % 1000000007 << endl;
}
