#include <bits/stdc++.h>
long long int comb(long long int n, long long int k) {
  long long int num = 1;
  long long int i;
  for (i = 1; i <= k; i++) {
    num = num * (n - i + 1) / i;
  }
  return num;
}
int main(void) {
  int M, N;
  long long int a[100000];
  int i = 0;
  long long int ans = 1;
  long long int cnt = 0;
  long long int div = 1000000007;
  scanf("%d %d", &N, &M);
  for (i = 0; i < M; i++) {
    scanf("%d", &a[i]);
    if (i != 0 && a[i - 1] + 1 == a[i]) {
      printf("0");
      return 0;
    }
  }
  a[M] = N;
  long long int numtwo = (a[0] - 1) / 2;
  long long int numone = (a[0] + 1) % 2;
  if (M == 0) {
    numtwo = a[0] / 2;
    numone = a[0] % 2;
  }
  for (i = 0; i <= M; i++) {
    cnt = 0;
    if (i == 0) {
      while (numtwo != 0) {
        cnt +=
            comb(numone + numtwo, (numone >= numtwo ? numtwo : numone)) % div;
        numtwo--;
        numone += 2;
      }
      ans = ans * (cnt + 1) % div;
      continue;
    } else if ((a[i] - 1) - (a[i - 1] + 1) >= 2 && i != M) {
      numtwo = (a[i] - a[i - 1] - 2) / 2;
      numone = (a[i] - a[i - 1] - 2) % 2;
      while (numtwo != 0) {
        cnt +=
            comb(numone + numtwo, (numone >= numtwo ? numtwo : numone)) % div;
        numtwo--;
        numone += 2;
      }
      ans = ans * (cnt + 1) % div;
    } else if (i == M) {
      numtwo = (a[M] - a[M - 1] - 1) / 2;
      numone = (a[M] - a[M - 1] - 1) % 2;
      while (numtwo != 0) {
        cnt +=
            comb(numone + numtwo, (numone >= numtwo ? numtwo : numone)) % div;
        numtwo--;
        numone += 2;
      }
      ans = ans * (cnt + 1) % div;
    }
  }
  printf("%lld", ans % div);
  return 0;
}
