#include <bits/stdc++.h>
using namespace std;
int factrial(int n) {
  if (n <= 1)
    return 1;
  else
    return n * factrial(n - 1);
}
int Combo(int n, int k) {
  if (k == 0)
    return 1;
  else if (k == n)
    return 1;
  else {
    return factrial(n) / (factrial(n - k) * factrial(k));
  }
}
int calcCombos(int startStep, int endStep) {
  int numSteps = endStep - startStep;
  int sumCombos = 0;
  int k;
  k = numSteps / 2;
  for (int i = 0; i <= k; i++) {
    sumCombos += Combo(numSteps - i, i);
  }
  return sumCombos;
}
int analyze(int numSteps, vector<int> brokenSteps) {
  vector<int> partialPatterns;
  for (int i = 1; i < brokenSteps.size(); i++) {
    if (brokenSteps.at(i - 1) + 1 == brokenSteps.at(i)) return 0;
  }
  int startStep = 0;
  for (int j = 0; j < brokenSteps.size(); j++) {
    partialPatterns.push_back(calcCombos(startStep, brokenSteps.at(j) - 1));
    startStep = brokenSteps.at(j) + 1;
  }
  int numPatterns = 1;
  for (int k = 0; k < partialPatterns.size(); k++)
    numPatterns *= partialPatterns.at(k);
  return numPatterns % 1000000007;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> brokenSteps(M);
  for (int i = 0; i < M; i++) {
    cin >> brokenSteps.at(i);
  }
  brokenSteps.push_back(N + 1);
  cout << analyze(N, brokenSteps) << endl;
}
