#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 n, m;
  cin >> n >> m;
  vector<int> a(m), v(n);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  v[0] = 1;
  v[1] = 2;
  if (vector_finder(a, 1)) {
    v[0] = 0;
    v[1] = 1;
  }
  if (vector_finder(a, 2)) v[1] = 0;
  for (int i = 2; i < n; i++) {
    if (vector_finder(a, i + 1)) {
      v[i] = 0;
    } else
      v[i] = (v[i - 1] + v[i - 2]) % 1000000007;
  }
  cout << v[n - 1] << endl;
  return 0;
}
