#include <bits/stdc++.h>
using namespace std;
unsigned long long fact(int n);
long comb(long n, long r);
unsigned long long fact(long n) {
  long i;
  unsigned long long f;
  f = 1;
  if (n != 0) {
    for (i = 1; i <= n; i++) {
      f = f * (unsigned long long)i;
    }
  }
  return f;
}
long comb(long n, long r) { return long(fact(n) / (fact(r) * fact(n - r))); }
int main() {
  long N, M, i, j;
  long b, c, d;
  cin >> N >> M;
  long a[M + 2];
  a[0] = -1;
  for (i = 1; i <= M; i++) {
    cin >> a[i];
  }
  a[M + 1] = N + 1;
  d = 1;
  for (i = 0; i <= M; i++) {
    b = a[i + 1] - a[i] - 2;
    c = 0;
    if (b == -1) {
      c = 0;
    } else {
      for (j = 0; j <= b / 2; j++) {
        c = c + comb((b - j), j);
      }
    }
    d = d * c;
    d = d % 1000000007;
  }
  cout << d;
}
