#include <bits/stdc++.h>
using namespace std;
long comb(long x, long y) {
  long dmy1 = 1;
  long dmy = 1;
  long xx = x;
  long yy = y;
  for (long i = 0; i < y; i++) {
    dmy1 *= xx;
    xx--;
    dmy *= yy;
    yy--;
  }
  return dmy1 / dmy;
}
long count(long n) {
  if (n == 1) {
    return 0;
  }
  if (n == 2) {
    return 1;
  }
  long nn = n - 2;
  long iter = nn / 2;
  long ans = 0;
  for (long i = 0; i <= iter; i++) {
    ans += comb(nn - i, i);
  }
  return ans;
}
int main() {
  long n, m;
  cin >> n >> m;
  vector<long> a;
  for (long i = 0; i < m; i++) {
    long x;
    cin >> x;
    a.push_back(x);
  }
  long ans = count(a[0] + 1);
  for (long i = 0; i < m - 1; i++) {
    ans *= count(a[i + 1] - a[i]);
  }
  ans *= count(n - a[m - 1] + 1);
  cout << ans % 1000000007;
  return 0;
}
