#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> vec(m + 1, 0);
  int bs = -2;
  long long ans = 1;
  for (int i = 1; i <= m; i++) {
    cin >> vec[i];
    if (bs + 1 == vec[i]) {
      cout << 0;
      return 0;
    }
    bs = vec[i];
    vector<long long> stair(vec[i] - vec[i - 1], 1);
    for (int j = 0; j < vec[i] - vec[i - 1] - 2; j++) {
      stair[j + 2] = stair[j] + stair[j + 1];
    }
    ans *= stair[vec[i] - vec[i - 1] - 1];
    ans %= 1000000007;
  }
  if (m == 0) {
    vec[0] = -1;
  }
  vector<long long> stair(n - vec[m] + 1, 1);
  for (int j = 0; j < n - vec[m] - 1; j++) {
    stair[j + 2] = stair[j] + stair[j + 1];
  }
  ans *= stair[n - vec[m] - 1];
  ans %= 1000000007;
  cout << ans;
}
