#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T = ll>
inline T in() {
  T ret;
  cin >> ret;
  return ret;
}
array<ll, 100001> fac_mod;
array<ll, 100001> fac_inv;
ll pow_mod(ll x, ll y) {
  return (y == 0 ? 1
          : y % 2 == 0
              ? pow_mod(((x % 1000000007) * (x % 1000000007)) % 1000000007,
                        y / 2)
              : (x % 1000000007) * pow_mod((x % 1000000007), y - 1)) %
         1000000007;
}
ll stare(ll n) {
  ll ret = 0;
  for (ll a = n, b = 0; a >= 0; a -= 2, b += 1) {
    ret += ((((fac_mod[a + b] % 1000000007) * (fac_inv[a] % 1000000007)) %
             1000000007) *
            (fac_inv[b] % 1000000007)) %
           1000000007;
  }
  return ret;
}
int main() {
  fac_mod[0] = 1;
  for (ll i = 1, i_len = (100000); i <= i_len; ++i)
    fac_mod[i] =
        (((fac_mod[i - 1]) % 1000000007) * (i % 1000000007)) % 1000000007;
  for (ll i = 0, i_len = (100001); i < i_len; ++i)
    fac_inv[i] = pow_mod(fac_mod[i], 1000000007 - 2);
  ll n = in(), m = in();
  vector<ll> a(m);
  for (ll i = 0, i_len = (m); i < i_len; ++i) a[i] = in();
  ll now = 0, ans = 1;
  for (ll i = 0, i_len = (m); i < i_len; ++i) {
    ans %= 1000000007;
    ans = ans * stare(a[i] - now - 1) % 1000000007;
    now = a[i] + 1;
  }
  ans %= 1000000007;
  cout << ans * stare(n - now) % 1000000007 << endl;
}
