#include <bits/stdc++.h>
using namespace std;
class triplet {
 public:
  long long x, y, g;
};
triplet ExtendedEuclid(long long a, long long b) {
  if (b == 0) {
    triplet ans;
    ans.g = a;
    ans.x = 1;
    ans.y = 0;
    return ans;
  }
  triplet smallAns = ExtendedEuclid(b, a % b);
  triplet ans;
  ans.g = smallAns.g;
  ans.x = smallAns.y;
  ans.y = smallAns.x - (a / b) * smallAns.y;
  return ans;
}
long long MultiplicativeModuloInverse(long long a, long long m) {
  triplet ans = ExtendedEuclid(a, m);
  return (ans.x % m + m) % m;
}
int solve(int A, vector<int> &B) {
  sort(B.begin(), B.end());
  long long fact[1007];
  fact[0] = fact[1] = 1;
  for (long long i = 2; i < 1007; i++) {
    fact[i] = ((fact[i - 1] % 1000000007) * i) % 1000000007;
  }
  long long pow2[1007];
  pow2[0] = 1;
  for (int i = 1; i < 1007; i++) {
    pow2[i] = (2 * pow2[i - 1]) % 1000000007;
  }
  long long ans = fact[(A - B.size())] % 1000000007;
  long long k = B.size();
  long long a = B[0] - 1, c = A - B[k - 1];
  for (int i = 1; i < k; i++) {
    long long temp = fact[B[i] - B[i - 1] - 1] % 1000000007;
    long long t = MultiplicativeModuloInverse(temp, 1000000007);
    ans = (ans * t) % 1000000007;
  }
  long long t = MultiplicativeModuloInverse(fact[a], 1000000007);
  ans = (ans * t) % 1000000007;
  t = MultiplicativeModuloInverse(fact[c], 1000000007);
  ans = (ans * t) % 1000000007;
  for (int i = 1; i < k; i++) {
    long long d = B[i] - B[i - 1] - 1;
    if (d == 0) continue;
    long long t = pow2[d - 1] % 1000000007;
    ans = (ans * t) % 1000000007;
  }
  return (int)ans;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  int t = 1;
  while (t--) {
    int a;
    cin >> a;
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int q;
      cin >> q;
      v.push_back(q);
    }
    cout << solve(a, v) << endl;
  }
  return 0;
}
