#include <bits/stdc++.h>
using namespace std;
long long md = 1000000007;
vector<long long> kai(100003);
long long func(int x) {
  x--;
  if (x <= 1) return 1;
  int y = x / 2;
  long long ans = 0;
  for (int i = 0; i <= y; i++) {
    int b = x - 2 * i;
    ans += kai[i + b] / (kai[i] * kai[b]);
    ans %= md;
  }
  return ans;
}
int main(int, char**) {
  kai[0] = 1;
  for (int i = 1; i < 100002; ++i) kai[i] = kai[i - 1] * i;
  long long ans = 1;
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (i > 0) {
      if (a[i] - a[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  if (m > 0)
    ans = func(a[0]);
  else {
    ans = func(n + 1);
    cout << ans << endl;
    return 0;
  }
  for (int i = 1; i < m; i++) {
    ans *= func(a[i] - a[i - 1] - 1);
    ans %= md;
  }
  ans *= func(n - a[m - 1]);
  ans %= md;
  cout << ans << endl;
  return 0;
}
