#include <bits/stdc++.h>
long long kaijo(int num) {
  int fact = 1;
  for (int i = 0; i < num; i++) {
    fact = fact * i;
  }
  return fact;
}
long long comb(int z, int b) {
  int s = kaijo(z + b);
  int q = kaijo(z);
  int r = kaijo(b);
  long long ans = s / (q * r);
  return ans;
}
int main(void) {
  int n, m;
  int a[100000];
  int i, j, o;
  int long ans = 0;
  long long k[100000];
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    k[i] = 0;
  }
  a[m] = n;
  k[m] = 0;
  int first = 0;
  int leng;
  int A, b;
  for (i = 0; i <= m; i++) {
    if (i < m && a[i + 1] - a[i] == 1)
      ;
    leng = a[i] - first;
    b = leng / 2;
    for (j = b; j >= 0; j--) {
      A = leng - 2 * j;
      k[i] += comb(A, b);
    }
    first = a[i] + 1;
  }
  for (i = 0; i <= m; i++) {
    ans *= k[i];
  }
  ans = ans % 1000000007;
  printf("%d\n", ans);
  return 0;
}
