#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> a;
  long long N;
  long long M;
  cin >> N;
  cin >> M;
  long long now_stage = 0;
  long long count = 1;
  for (long long i = 0; i < M; ++i) {
    long long k;
    cin >> k;
    a.push_back(k - 1);
  }
  a.push_back(N);
  for (long long i = 0; i < a.size(); ++i) {
    if (a[i] - now_stage == -1) {
      cout << 0 << endl;
      return 0;
    }
    long long stage = (a[i]) - now_stage;
    long long number_of_two;
    long long number_of_one;
    if (stage % 2 == 1) {
      number_of_two = (stage - 1) / 2;
      number_of_one = 1;
    } else {
      number_of_two = (stage) / 2;
      number_of_one = 0;
    }
    long long count_k = 0;
    for (; number_of_two >= 0;) {
      long long p = 1, q = 1, n = 1;
      for (long long j = 1; j <= number_of_two; ++j) {
        p *= j;
      }
      for (long long j = 1; j <= number_of_one; ++j) {
        q *= j;
      }
      for (long long j = 1; j <= number_of_one + number_of_two; ++j) {
        n *= j;
      }
      count_k += n / (p * q);
      --number_of_two;
      number_of_one += 2;
    }
    count *= count_k;
    now_stage = a[i] + 2;
  }
  cout << count % 1000000007 << endl;
  return 0;
}
