#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long factorial(long long a) {
  long long ans = 1;
  for (long long i = 1; i <= a; i++) {
    ans *= i;
  }
  return ans;
}
signed main() {
  long long mod = 1000000007;
  long long n, m;
  cin >> n >> m;
  vector<long long> hole(m);
  for (long long i = (long long)(0); i < (long long)(m); i++) {
    cin >> hole[i];
  }
  for (long long i = (long long)(0); i < (long long)(m - 1); i++) {
    if (hole[i] + 1 == hole[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long ans = 1;
  long long top = hole[0] - 1;
  long long lowest = 0;
  long long temp = (top - lowest);
  long long x = temp % 2;
  long long y = temp / 2;
  long long tem = 0;
  while (y > -1) {
    tem += factorial(x + y) / (factorial(y) * factorial(x));
    y--;
    x += 2;
  }
  ans = ans * tem % mod;
  tem = 0;
  for (long long i = (long long)(1); i < (long long)(m); i++) {
    lowest = top + 2;
    top = hole[i] - 1;
    temp = (top - lowest);
    x = temp % 2;
    y = temp / 2;
    while (y > -1) {
      tem += factorial(x + y) / (factorial(y) * factorial(x));
      y--;
      x += 2;
    }
    ans = ans * tem % mod;
    tem = 0;
  }
  lowest = top + 2;
  top = n;
  temp = (top - lowest);
  x = temp % 2;
  y = temp / 2;
  while (y > -1) {
    tem += factorial(x + y) / (factorial(y) * factorial(x));
    y--;
    x += 2;
  }
  ans = ans * tem % mod;
  cout << ans << endl;
  return 0;
}
