#include <bits/stdc++.h>
using namespace std;
long long get_ways(long long n) {
  if (n < 0) {
    return 0;
  }
  int a = n / 2;
  int b = n % 2;
  long long ans = 1;
  for (int i = 1; i <= a; ++i) {
    long long x1 = 1;
    long long x2 = 1;
    long long x3 = 1;
    for (int j = 0; j < i; ++j) {
      x1 *= (n - 2 * i + i) - j;
      x2 *= i - j;
    }
    ans += (x1 / x2);
  }
  cout << "**" << ans << endl;
  return ans;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; ++i) {
    cin >> a.at(i);
  }
  vector<long long> ways;
  ways.push_back(get_ways(a.at(0) - 1 - 0));
  for (int i = 1; i < M; ++i) {
    ways.push_back(get_ways((a.at(i) - 1) - (a.at(i - 1) + 1)));
  }
  ways.push_back(get_ways(N - (a.at(M - 1) + 1)));
  long long ans = 1;
  for (auto i : ways) {
    ans *= (i % 1000000007);
  }
  for (int i = 0; i < 10; ++i) {
    cout << "get_ways(" << i << ")=> " << get_ways(i) << endl;
  }
  ans = ans % 1000000007;
  cout << ans << endl;
  return 0;
}
