#include <bits/stdc++.h>
using namespace std;
long long calc_comb(int p, int r);
long long calc_routes(int stair_count, int broken_count,
                      vector<int> broken_stairs);
long long calc_comb(int p, int r) {
  long long mul = 1;
  if (p - r > r) {
    r = p - r;
  }
  for (int i = p; i > r; i--) {
    mul *= i;
    mul %= 1000000007;
  }
  for (int i = 2; i <= p - r; i++) {
    if (mul < i) {
      mul *= 1000000007;
    }
    mul /= i;
  }
  return mul;
}
long long calc_routes(int stair_count, int broken_count,
                      vector<int> broken_stairs) {
  long long route_sum = 1;
  int split_pointer = 0;
  vector<int>::iterator itr;
  for (itr = broken_stairs.begin(); itr != broken_stairs.end(); itr++) {
    if (itr + 1 != broken_stairs.end()) {
      if (*(itr + 1) - *itr == 1) {
        return 0;
      }
    }
    int i = *itr - split_pointer - 1;
    int j = 0;
    long long part_sum = 0;
    while (i >= j) {
      part_sum += calc_comb(i, j);
      part_sum %= 1000000007;
      i--;
      j++;
    }
    route_sum *= part_sum;
    route_sum %= 1000000007;
    split_pointer = *itr + 1;
  }
  int i = stair_count - split_pointer;
  int j = 0;
  long long part_sum = 0;
  while (i >= j) {
    part_sum += calc_comb(i, j);
    part_sum %= 1000000007;
    i--;
    j++;
  }
  route_sum *= part_sum;
  route_sum %= 1000000007;
  return route_sum;
}
int main(void) {
  int stair_count;
  int broken_count;
  vector<int> broken_stairs;
  cin >> stair_count >> broken_count;
  for (int i = 0; i < broken_count; i++) {
    int bs;
    cin >> bs;
    broken_stairs.push_back(bs);
  }
  cout << calc_routes(stair_count, broken_count, broken_stairs) % 1000000007
       << endl;
  return 0;
}
