#include <bits/stdc++.h>
using namespace std;
int64_t p = pow(10, 9) + 7;
int64_t fac(int a) {
  if (a == 0) {
    return 1;
  }
  if (a == 1) {
    return 1;
  }
  return (a * fac(a - 1));
}
int64_t com(int a, int b) {
  if (b == 0) {
    return 1;
  }
  if (a == b) {
    return 1;
  }
  return fac(a) / (fac(b) * fac(a - b));
}
int64_t fun(int a) {
  int64_t ans = 0;
  if (a == 0) {
    return 0;
  }
  for (int i = 0; i <= (a / 2); i++) {
    ans += com(a - i, i);
  }
  return ans;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  cin >> a.at(0);
  int64_t ans = 0;
  for (int i = 1; i < M; i++) {
    cin >> a.at(i);
    if (a.at(i) - a.at(i - 1) == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  ans += fun(a.at(0) - 1);
  for (int i = 1; i < M; i++) {
    ans += fun((a.at(i) - 1) - (a.at(i - 1) + 1));
  }
  ans += fun(N - (a.back() + 1));
  ans %= p;
  if (ans == 0) {
    cout << 1 << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}
