#include <bits/stdc++.h>
using namespace std;
long waru = pow(10, 9) + 7;
int vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return 1;
  } else {
    return 0;
  }
}
long long func(int s, vector<long long> &p, vector<int> a) {
  if (p.at(s) > -1) {
    return p.at(s);
  } else if (vector_finder(a, s) == 1) {
    return p.at(s) = 0;
  } else if (s == 0) {
    return p.at(s) = 1;
  } else if (s == 1) {
    return p.at(s) = func(s - 1, p, a) % waru;
  } else {
    return p.at(s) = (func(s - 1, p, a) + func(s - 2, p, a)) % waru;
  }
}
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);
  for (int i = 0; i < N; i++) {
    p.at(i) = -1;
  }
  int point = 0;
  if (false) {
    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);
      }
      p.at(s) = p.at(s) % waru;
    }
  } else {
    func(N - 1, p, a);
  }
  cout << p.at(N - 1);
}
