#include <bits/stdc++.h>
using namespace std;
long long combination(int a, int b) {
  long long combi = 1;
  for (int i = 0; i < b; i++) {
    combi *= (a - i) / (b - i);
  }
  return combi;
}
long long pattern(int step) {
  long long sum = 1;
  int half = step / 2;
  if (half != 0) {
    for (int i = 1; i <= half; i++) {
      sum += combination(step - i, i);
    }
  }
  sum = sum % 1000000007;
  return sum;
}
int main() {
  int n;
  int m;
  int tmp;
  int step_size;
  int start = 0;
  long long total_pattern = 1;
  vector<int> a;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    a.push_back(tmp);
  }
  for (int i = 0; i < m; i++) {
    if (i == 0) {
      step_size = a[i] - 1;
      total_pattern *= pattern(step_size);
    } else {
      step_size = a[i] - a[i - 1] - 1;
      if (step_size == 0) {
        total_pattern *= 0;
      } else {
        total_pattern *= pattern(step_size);
      }
    }
    total_pattern = total_pattern % 1000000007;
  }
  step_size = n - a[m - 1] - 1;
  total_pattern *= pattern(step_size);
  total_pattern = total_pattern % 1000000007;
  cout << total_pattern << endl;
}
