#include <bits/stdc++.h>
using namespace std;
long long int combination(int diff) {
  if (diff == 1) return 0;
  long long int a, b, c;
  a = 0;
  b = 1;
  for (int i = 1; i < diff - 1; i++) {
    c = a + b;
    a = b;
    b = c;
  }
  return c;
}
int main() {
  int N, M;
  long long int mod = 1E+9 + 7;
  cin >> N >> M;
  vector<int> a(M + 2);
  a.at(0) = -1;
  for (int i = 1; i <= M; i++) {
    cin >> a.at(i);
  }
  a.at(M + 1) = N + 1;
  long long int ans = 1;
  for (int i = 0; i < M + 1; i++) {
    ans = (ans * (combination(a.at(i + 1) - a.at(i)) % mod)) % mod;
  };
  cout << ans << endl;
}
