#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[100000];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  queue<int> que;
  for (int i = 0; i < m; i++) {
    que.push(a[i]);
  }
  que.push(n + 1);
  int start = -1;
  int end = 0;
  long long ans = 1;
  while (que.size()) {
    end = que.front();
    que.pop();
    if (end - start == 1) {
      cout << 0 << endl;
      return 0;
    } else if (end - start > 2) {
      int dansu = (end - 1) - (start + 1) + 1;
      long long aa = 0;
      for (int i = 0; i < dansu; i++) {
        if (i * 2 > dansu) break;
        int x = i;
        int y = dansu - x * 2 - 1;
        int z = x + y;
        long long ue = 1, shita = 1;
        for (int j = 1; j <= z; j++) {
          ue *= j;
          if (j <= x) {
            shita *= j;
          }
          if (j <= y) {
            shita *= j;
          }
        }
        int a = ue / shita;
        aa += a;
      }
      ans *= aa;
    }
    start = end;
  }
  ans = ans % 1000000007;
  cout << ans << endl;
  return 0;
}
