#include <iostream>
#include <stdio.h>

#define INF 1'000'000'007

typedef long long ll;

using namespace std;

ll comb(ll n, ll k) {
  if (n == 0 || k == 0) {
    return 1;
  }
  ll a = n;
  for (ll i = n - 1; i > n - k; --i) {
    a *= i;
  }
  ll b = 1;
  for (ll i = 2; i <= k; ++i) {
    b *= i;
  }
  return a / b;
}

int main() {
  int N, M;
  cin >> N >> M;
  ll cnt = -1;
  ll res = 1;
  for (int i = 0; i < M; ++i) {
    int a;
    cin >> a;
    ll t = a - cnt - 2;
    if (t < 0) {
      res = 0;
    } else {
      ll _t = 0;
      for (ll i = 0; i <= t / 2; ++i) {
        _t += comb(t - i, i);
      }
      res = (res * (_t % INF)) % INF;
    }
    cnt = a;
  }
  ll _t = 1;
  ll t = N - cnt - 1;
  if (t > 0) {
    for (ll i = 1; i <= t / 2; ++i) {
      _t += comb(t - i, i);
    }
  }
  printf("%lld\n", (res * (_t % INF) % INF));
}