#include <bits/stdc++.h>
using namespace std;
int a[100000];
long nCk(long n, int k) {
  long r = 1;
  for (long d = 1; d <= k; ++d) {
    r *= n--;
    r /= d;
  }
  return r;
}
long p(int k) {
  if (k < 2) {
    return 0;
  } else if (k <= 3) {
    return 1;
  } else {
    int res = 0;
    for (int i = 0; i <= (k - 2) / 2; i++) {
      int l = (k - 2) - i * 2;
      res += nCk(l + i, i);
    }
    return res;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a, a + m);
  long result = p(a[0] + 1);
  for (int i = 0; i < m - 1; i++) {
    result *= p(a[i + 1] - a[i]);
    if (result == 0) break;
    result %= 1000000007;
  }
  result *= p(n + 1 - a[m - 1]);
  result %= 1000000007;
  cout << result << endl;
  return 0;
}
