#include <bits/stdc++.h>
using namespace std;
vector<unsigned long long> memo(100100);
unsigned long long fibonacci_recursive(int n) {
  if (n == 1 || n == 2)
    memo[n] = 1;
  else if (n >= 3) {
    if (!memo[n])
      memo[n] = fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2);
  }
  return memo[n];
}
int main(void) {
  int N, M;
  int i;
  cin >> N >> M;
  vector<int> a(2 * M);
  vector<unsigned long long> res(2 * N);
  for (i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (i = 0; i < M - 1; i++) {
    if ((a[i + 1] - a[i]) <= 1) {
      cout << "0" << endl;
      return 0;
    }
  }
  res[0] = 1;
  for (i = 1; i <= N; i++) {
    auto itr = find(a.begin(), a.end(), i);
    size_t index = distance(a.begin(), itr);
    if (index != a.size())
      res[i] = 0;
    else {
      if (i == 1)
        res[i] = 1;
      else
        res[i] = res[i - 1] + res[i - 2];
    }
  }
  cout << res[N] % (unsigned long long)(1e9 + 7) << endl;
  return 0;
}
