#include <bits/stdc++.h>
using namespace std;
int kaijo(int n) {
  int res = 1;
  if (n >= 2)
    for (int i = 2; i <= n; i++) res *= i;
  return res;
}
int main() {
  int N, M;
  cin >> N >> M;
  int start = 0, goal = N, ans = 1;
  for (int i = 0; i <= M; i++) {
    if (i == M) {
      goal = N;
    } else {
      cin >> goal;
      goal--;
    }
    if (goal - start < 0) {
      ans = 0;
      break;
    } else if (goal - start < 2) {
      ans *= 1;
    } else {
      int s_to_g_num = 0;
      for (int two = 0; two <= (goal - start) / 2; two++) {
        int one = (goal - start) - 2 * two;
        s_to_g_num += kaijo(one + two) / kaijo(one) / kaijo(two);
      }
      ans *= s_to_g_num;
    }
    start = goal + 2;
  }
  cout << ans % 1000000007 << endl;
}
