#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> p(M + 1);
  p.at(0) = -1;
  for (int i = 1; i <= M; i++) {
    cin >> p.at(i);
  }
  int a = 0;
  if (M != 0) {
    a++;
  }
  vector<int> z(N + 1);
  z.at(0) = 1;
  z.at(1) = 1;
  if (p.at(a) == 1) {
    z.at(1) = 0;
    a++;
  }
  for (int i = 2; i <= N; i++) {
    if (p.at(a) == i) {
      z.at(i) = 0;
      if (a != M) {
        a++;
      }
    } else {
      z.at(i) = (z.at(i - 1) + z.at(i - 2)) % 1000000007;
    }
  }
  cout << z.at(N) << endl;
}
