#include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
long long fact(long long i) {
  if (i == 0) return 1;
  return i * fact(i - 1);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    long long ans = 0;
    for (int i = 0; i <= n / 2; ++i) {
      ans += fact(n - i) / fact(n - 2 * i) / fact(i);
    }
    cout << ans << "\n";
    return 0;
  }
  vector<long long> a = {};
  if (m > 0) {
    for (long long i = 0; i < m; ++i) {
      long long x;
      cin >> x;
      a.push_back(x);
      if (i > 0 && a[i] - a[i - 1] == 1) {
        cout << 0 << "\n";
        return 0;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= (a[0] - 1) / 2; ++i) {
    ans += fact(a[0] - 1 - i) / fact(a[0] - 1 - 2 * i) / fact(i);
  }
  if (ans > mod) ans = (ans % mod);
  for (int i = 1; i < m; ++i) {
    long long d = a[i] - a[i - 1] - 2;
    long long sub = 0;
    for (int j = 0; j <= d / 2; ++j) {
      sub += fact(d - j) / fact(d - 2 * j) / fact(j);
    }
    ans *= sub;
    if (ans > mod) ans = (ans % mod);
  }
  long long sub = 0;
  for (int i = 0; i <= (n - a[m - 1] - 1) / 2; ++i) {
    sub +=
        fact(n - a[m - 1] - 1 - i) / fact(n - a[m - 1] - 1 - 2 * i) / fact(i);
  }
  ans *= sub;
  if (ans > mod) ans = (ans % mod);
  cout << ans << "\n";
  return 0;
}
