#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int a[100001];
pair<int, int> cnt[100001];
long long comb(long long first, long long second) {
  if (second == 0) return 1;
  long long tot = 1;
  long long firstT = first;
  long long secondT = second;
  for (int i = 0; i < (second); ++i) tot = (tot * (firstT--)) % 1000000007;
  for (int i = 0; i < (second); ++i)
    while (!(tot % secondT == 0)) tot += 1000000007;
  tot /= (secondT--);
  tot = ((long long)tot) % 1000000007;
  return tot % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M;
  cin >> N >> M;
  for (int i = (1); i < (M + 1); i++) cin >> a[i];
  for (int i = (1); i < (M); i++)
    if (abs(a[i] - a[i + 1]) == 1) {
      cout << 0;
      return 0;
    }
  int idx = 0;
  if (M == 0) {
    cnt[idx++] = make_pair(N % 2, N / 2);
  } else {
    for (int i = (1); i < (M + 1); i++) {
      if (i == 1) {
        cnt[idx++] = make_pair((a[i] - 1) % 2, (a[i] - 1) / 2);
      } else {
        cnt[idx++] =
            make_pair((a[i] - a[i - 1] - 1) % 2, (a[i] - a[i - 1] - 1) / 2);
      }
    }
  }
  if (a[M] != N) cnt[idx++] = make_pair((N - a[M] - 1) % 2, (N - a[M] - 1) / 2);
  long long tot = 1;
  long long other = 0;
  for (int i = (0); i < (idx); i++) {
    while (cnt[i].second >= 0) {
      other += (comb((cnt[i].first + cnt[i].second),
                     min(cnt[i].first, cnt[i].second))) %
               1000000007;
      other %= 1000000007;
      cnt[i].second--;
      cnt[i].first += 2;
    }
    tot = (tot * other) % 1000000007;
    other = 0;
  }
  cout << tot;
  return 0;
}
