#include <bits/stdc++.h>

using namespace std;
using ll = long long;

ll mod = 1000000007;
ll N, M;
vector<ll> a;

template<unsigned int mod_>
struct ModInt {
  using uint = unsigned int;
  using ll = long long;
  using ull = unsigned long long;

  constexpr static uint mod = mod_;

  uint v;

  ModInt() : v(0) {}

  ModInt(ll _v) : v(normS(_v % mod + mod)) {}

  explicit operator bool() const { return v != 0; }

  static uint normS(const uint &x) { return (x < mod) ? x : x - mod; }    // [0 , 2*mod-1] -> [0 , mod-1]
  static ModInt make(const uint &x) {
    ModInt m;
    m.v = x;
    return m;
  }

  ModInt operator+(const ModInt &b) const { return make(normS(v + b.v)); }

  ModInt operator-(const ModInt &b) const { return make(normS(v + mod - b.v)); }

  ModInt operator-() const { return make(normS(mod - v)); }

  ModInt operator*(const ModInt &b) const { return make((ull) v * b.v % mod); }

  ModInt operator/(const ModInt &b) const { return *this * b.inv(); }

  ModInt &operator+=(const ModInt &b) { return *this = *this + b; }

  ModInt &operator-=(const ModInt &b) { return *this = *this - b; }

  ModInt &operator*=(const ModInt &b) { return *this = *this * b; }

  ModInt &operator/=(const ModInt &b) { return *this = *this / b; }

  ModInt &operator++(int) { return *this = *this + 1; }

  ModInt &operator--(int) { return *this = *this - 1; }

  ll extgcd(ll a, ll b, ll &x, ll &y) const {
    ll p[] = {a, 1, 0}, q[] = {b, 0, 1};
    while (*q) {
      ll t = *p / *q;
      for (int i = 0; i < 3; ++i) {
        swap(p[i] -= t * q[i], q[i]);
      }
    }
    if (p[0] < 0) {
      for (int i = 0; i < 3; ++i) {
        p[i] = -p[i];
      }
    }
    x = p[1], y = p[2];
    return p[0];
  }

  ModInt inv() const {
    ll x, y;
    extgcd(v, mod, x, y);
    return make(normS(x + mod));
  }

  ModInt pow(ll p) const {
    if (p < 0) return inv().pow(-p);
    ModInt a = 1;
    ModInt x = *this;
    while (p) {
      if (p & 1) a *= x;
      x *= x;
      p >>= 1;
    }
    return a;
  }

  bool operator==(const ModInt &b) const { return v == b.v; }

  bool operator!=(const ModInt &b) const { return v != b.v; }

  friend istream &operator>>(istream &o, ModInt &x) {
    ll tmp;
    o >> tmp;
    x = ModInt(tmp);
    return o;
  }

  friend ostream &operator<<(ostream &o, const ModInt &x) { return o << x.v; }
};

using mint = ModInt<1000000007>;

// 階乗、階乗の逆元、逆元
const int MAX = 510000;
mint fact[MAX], finv[MAX], inv[MAX];

// 階乗、逆元の前処理
void Cinit() {
  fact[0] = fact[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fact[i] = fact[i - 1] * i;
    inv[i] = -(inv[mod % i] * (mod / i));
    finv[i] = finv[i - 1] * inv[i];
  }
}

// combination
mint nCk(ll n, ll k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fact[n] * (finv[k] * finv[n - k]);
}

int main() {
  Cinit();
  cin >> N >> M;
  a = vector<ll>(M);
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
    if(i>0 && a[i]-a[i-1]==1){
      cout << 0 << endl;
      return 0;
    }
  }
  mint ret=1;
  ll c;
  ll d;
  ll s = 0;
  for (int i = 0; i < M; ++i) {
    mint r = 0;
    ll b = a[i]-s-1;
    c = b/2;
    d = b%2==0 ? 0:1;
    while(c>0){
      r += nCk(c+d,c);
      c--;
      d+=2;
    }
    r++;
    s=a[i]+1;
    ret *= r;
  }
  mint r = 0;
  ll b = N-s;
  c = b/2;
  d = b%2==0 ? 0:1;
  while(c>0){
    r += nCk(c+d,c);
    c--;
    d+=2;
  }
  r++;
  ret *= r;
  cout << ret << endl;
}


Measured memory_bytes: 7040