#include <bits/stdc++.h>
using namespace std;
long calcPat(long n) {
  long m = n + 1;
  return (long)((pow((1 + sqrt(5)) / 2, m) - pow((1 - sqrt(5)) / 2, m)) /
                sqrt(5));
}
int main() {
  int N, M;
  cin >> N >> M;
  int ans = 0;
  long sum = 1;
  vector<long> list;
  long pre = 0;
  for (int t = 0; t < M; t++) {
    long n;
    cin >> n;
    if (pre == n - 1) {
      if (pre == 0) {
        pre = n;
        continue;
      }
      cout << "0" << endl;
      return 0;
    }
    sum *= calcPat(n - pre - 1);
    pre = n;
  }
  sum *= calcPat(N - pre - 1);
  sum = sum % 1000000007L;
  cout << sum << endl;
  return 0;
}
