#include <bits/stdc++.h>
using namespace std;
long nCr(int n, int r) {
  long ans = 1;
  for (int i = n; i > n - r; --i) {
    ans = ans * i;
  }
  for (int i = 1; i < r + 1; ++i) {
    ans = ans / i;
  }
  return ans;
}
int main() {
  int N, M;
  cin >> N >> M;
  int A;
  int current = 0;
  long sum = 1;
  for (int i = 0; i < M + 1; i++) {
    if (i != M) {
      cin >> A;
      if (current == A) {
        sum = 0;
        break;
      }
    } else {
      A = N + 1;
    }
    int len = A - 1 - current;
    long tmp = 0;
    for (int j = 0; j <= len / 2; j++) {
      int k = len - j * 2;
      tmp += nCr(j + k, j);
    }
    current = A + 1;
    sum = sum * tmp % (int)(1e9 + 7);
  }
  cout << sum << endl;
  return 0;
}
