#include <bits/stdc++.h>
using namespace std;
unsigned long int fact(long long int n) {
  long int i, k;
  if (n == 0 || n == 1)
    return 1;
  else {
    k = n;
    for (i = 2; i < k; i++) {
      n = i * n;
    }
  }
  return n;
}
long long int possibility(long long int b, long long int a) {
  long long int c = b - a;
  long long int p, k = 0, s = 0;
  unsigned long i, j;
  p = c / 2;
  if (c % 2 != 0) {
    k = 1;
  }
  j = p;
  for (i = k; i <= c; i = i + 2) {
    s += (fact(j + i)) / (fact(i) * fact(j));
    j -= 1;
  }
  return s;
}
int main() {
  long long int m, n, i, p = 1;
  cin >> n >> m;
  long long int a[m + 1];
  for (i = 0; i < m; i++) {
    cin >> a[i];
  }
  a[m] = n + 1;
  i = 0;
  while (i != m) {
    p = (p * possibility(a[i + 1] - 1, a[i] + 1)) % 1000000007;
    i++;
  }
  p = p * possibility(a[0] - 1, 0);
  cout << (p % 1000000007);
  return 0;
}
