#include <bits/stdc++.h>
using namespace std;
uint64_t MOD = 1000000007;
int64_t FastPow(int64_t n, int64_t m) {
  if (m == 0) return 1;
  if (m == 1) return n;
  int64_t v = FastPow(n, m / 2);
  v *= v;
  v %= MOD;
  if (m % 2) {
    v *= n;
    v %= MOD;
  }
  return v;
}
int64_t RevSource(int64_t n) { return FastPow(n, MOD - 2); }
int64_t Factri(int64_t n) {
  int64_t v = 1;
  for (int i = 2; i < n + 1; i++) {
    v *= i;
    v %= MOD;
  }
  return v;
}
int64_t Perm(int64_t n, int64_t m) {
  int64_t v = Factri(n + m);
  v *= RevSource(Factri(n));
  v %= MOD;
  v *= RevSource(Factri(m));
  v %= MOD;
  return v;
}
int64_t solve(int n) {
  int64_t v = 0;
  int n2 = n / 2, n1 = n % 2;
  while (n2 >= 0) {
    int64_t _v = Perm(n2, n1);
    cout << _v << endl;
    v += _v;
    v %= MOD;
    n2--;
    n1 += 2;
  }
  return v;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A;
  A.push_back(-1);
  for (int m = 0; m < M; m++) {
    int a;
    cin >> a;
    A.push_back(a);
  }
  A.push_back(N + 1);
  int64_t ans = 1;
  for (int i = 1; i < A.size(); i++) {
    int d = A.at(i) - A.at(i - 1) - 2;
    if (d < 0) {
      ans = 0;
      break;
    }
    ans *= solve(d);
    ans %= MOD;
  }
  cout << ans << endl;
}
