#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M, now = 0, hole, maxi;
  long long result = 1;
  bool canDo = true;
  vector<int> step;
  vector<long long> fib;
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &hole);
    step.push_back(hole - now - 1);
    now = hole + 1;
  }
  step.push_back(N - now);
  sort(step.begin(), step.end());
  if (step.front() < 0) {
    cout << 0 << endl;
    return 0;
  }
  maxi = step.back();
  fib.push_back(1);
  fib.push_back(1);
  for (int i = 2; i <= maxi; i++)
    fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
  for (const auto &e : step) result = result * fib[e] % 1000000007;
  cout << result << endl;
  return 0;
}
