#include <bits/stdc++.h>
using namespace std;
long count(int n, long sum) {
  long countsum = 0;
  if (sum == n && n != 0) {
    return 1;
  } else if (sum > n) {
    return 0;
  } else if (n == 0) {
    return 1;
  }
  countsum += count(n, sum + 1);
  countsum += count(n, sum + 2);
  return countsum;
}
int main(void) {
  int n, m;
  long sum = 1;
  cin >> n >> m;
  int *a = new int[m + 1];
  a[0] = 0;
  for (int i = 1; i < m + 1; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) {
      cout << 0;
      return 0;
    }
  }
  for (int i = 0; i < m; i++) {
    sum *= count(a[i + 1] - 1 - a[i], 0);
  }
  sum *= count(n - a[m] - 1, 0);
  cout << sum % 1000000007;
  return 0;
}
