#include <bits/stdc++.h>
int forC(int a, int b);
int main(void) {
  int a, b, e, tmp, i, j, k;
  long ans, anst, l;
  scanf("%d", &a);
  scanf("%d", &b);
  int c[100];
  ans = 1;
  e = 0;
  for (i = 1; i < b + 1; i++) {
    c[0] = 0;
    scanf("%d", &c[i]);
    tmp = c[i] - c[i - 1] - 1;
    if (2 <= i && tmp + 1 == 1) {
      e++;
    }
    for (j = tmp, k = tmp; 0 < k; j -= 1, k -= 2) {
      l += forC(j, k);
    }
    if (tmp % 2 == 0) {
      ans *= (l + 1);
    } else if (tmp % 2 == 1) {
      ans *= l;
    }
    l = 0;
  }
  tmp = a - c[b] - 1;
  for (j = tmp, k = tmp; 0 < k; j -= 1, k -= 2) {
    l += forC(j, k);
    ;
  }
  if (tmp % 2 == 0) {
    ans *= (l + 1);
  } else if (tmp % 2 == 1) {
    ans *= l;
  }
  if (e >= 1) {
    ans = 0;
  }
  anst = ans % 1000000007;
  printf("%ld\n", anst);
  return 0;
}
int forC(int a, int b) {
  long c, d;
  c = 1;
  d = 1;
  for (; 0 < b; a -= 1, b -= 1) {
    c *= a;
    d *= b;
  }
  return c / d;
}
