#include <bits/stdc++.h>
using namespace std;
long vector_finder(std::vector<long> vec, long 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;
  }
}
void solve() {
  long n, m;
  cin >> n >> m;
  vector<long> a;
  for (long i = 0; i < m; i++) {
    long k;
    cin >> k;
    a.emplace_back(k);
  }
  vector<long> vec(n + 1);
  vec[0] = 1;
  if (a[0] == 1)
    vec[1] = 0;
  else
    vec[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (vector_finder(a, i) == 1)
      vec[i] = 0;
    else {
      vec[i] = (vec[i - 1] + vec[i - 2]) % 1000000007;
    }
  }
  cout << vec[n] << endl;
}
int main() {
  solve();
  return 0;
}
