#include <bits/stdc++.h>
long long kai(long long n, long long j) {
  long long k = 1, h = 1;
  long long t;
  if (n > j) {
    t = j;
    j = n;
    n = t;
  }
  for (int i = j + 1; i <= n + j; i++) {
    k *= i;
    k = k % 1000000007;
  }
  if (n != 0) {
    for (int i = 1; i <= n; i++) {
      h *= i;
      h = h % 1000000007;
    }
  }
  k = k / h;
  k = k % 1000000007;
  return k;
}
int main() {
  long long a, b = 0, n, m, o, p = 1, s, t, u;
  scanf("%lld %lld", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &a);
    if (a == b) {
      printf("0\n");
      exit(0);
    }
    a = a - 1;
    s = (a - b) / 2;
    t = (a - b) % 2;
    for (long long i = s; i >= 0; i--) {
      u = t + 2 * (s - i);
      o += kai(i, u);
    }
    p *= o;
    p = p % 1000000007;
    o = 0;
    b = a + 2;
  }
  s = (n - b) / 2;
  t = (n - b) % 2;
  for (long long i = s; i >= 0; i--) {
    u = t + 2 * (s - i);
    o += kai(i, u);
  }
  p *= o;
  p = p % 1000000007;
  printf("%lld\n", p);
  return 0;
}
