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