#include <bits/stdc++.h>
using namespace std;
int n;
int s[1003];
int m;
int fact1[1003];
int fact2[1003];
long long res;
int p[1003];
void toFact(int num, int st[]) {
  for (int i = 2; i <= 1000; i++) {
    if (!p[i]) {
      int k = num;
      while (k) {
        st[i] += k / i;
        k /= i;
      }
    }
  }
}
long long mod = (long long)(1e9) + 7;
void dealQ() {
  s[0] = 0;
  s[m + 1] = n + 1;
  for (int i = 1; i <= m + 1; i++) {
    int k = s[i] - s[i - 1] - 1;
    if (i != 1 && i != m + 1) {
      for (int j = 0; j < k - 1; j++) {
        res = res * 2ll % mod;
      }
    }
    memset(fact2, 0, sizeof(fact2));
    toFact(k, fact2);
    for (int j = 2; j <= 1000; j++) {
      fact1[j] -= fact2[j];
    }
  }
}
void calcF() {
  for (int i = 2; i <= 1000; i++) {
    while (fact1[i] > 0) {
      res = res * i % mod;
      fact1[i]--;
    }
  }
}
void getP() {
  memset(p, 0, sizeof(p));
  p[0] = p[1] = 1;
  for (int i = 2; i <= 1000; i++) {
    if (!p[i]) {
      int k = i + i;
      while (k <= 1000) {
        p[k] = 1;
        k += i;
      }
    }
  }
}
int main() {
  getP();
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 1; i <= m; i++) {
      scanf("%d", &s[i]);
    }
    sort(s + 1, s + 1 + m);
    res = 1ll;
    memset(fact1, 0, sizeof(fact1));
    toFact(n - m, fact1);
    dealQ();
    calcF();
    printf("%I64d\n", res);
  }
  return 0;
}
