#include <bits/stdc++.h>
using namespace std;
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;
  }
}
int main() {
  int mod = 1000000007;
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) cin >> a[i];
  vector<int> count(N + 1);
  count[0] = 1;
  if (a[0] == 1)
    count[1] = 0;
  else
    count[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (vector_finder(a, i)) {
      count[i] = 0;
      continue;
    } else {
      count[i] = (count[i - 1] + count[i - 2]) % mod;
    }
  }
  cout << count[N];
  return 0;
}
