#include <bits/stdc++.h>
int func(int n) {
  int tmp = 1;
  for (int i = 2; i <= n; i++) tmp *= i;
  return tmp;
}
int main() {
  long dim = 1000000007;
  int m, n, ans = 0;
  long sum = 0;
  std::cin >> n >> m;
  std::vector<int> a(m);
  std::vector<int> domain;
  for (int i = 0; i < m; i++) {
    std::cin >> a[i];
    if (i == 0) {
      domain.push_back(a[i] - 1);
    } else {
      domain.push_back(a[i] - a[i - 1] - 2);
      if (a[i] - a[i - 1] == 1) {
        std::cout << 0 << std::endl;
        return 0;
      }
    }
  }
  domain.push_back(n - a[m - 1] - 1);
  for (auto itr = domain.begin(); itr < domain.end(); itr++) {
    sum += 1;
    for (int i = 1; i <= *itr / 2; i++) {
      sum += func(*itr - i) / (func(i) * func(*itr - 2 * i));
    }
  }
  std::cout << sum % dim << std::endl;
  return 0;
}
