#include <bits/stdc++.h>
using namespace std;
long long int substep(long long int stairs);
int main() {
  long long int div = 1000000007;
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 1);
  a[0] = -1;
  for (int i = 1; i <= M; i++) cin >> a[i];
  long long int steps = 1;
  for (int i = 1; i <= M; i++) {
    steps *= substep(a[i] - a[i - 1] - 2);
    steps %= div;
  }
  steps *= substep(N - a[M] - 1);
  steps %= div;
  cout << steps << endl;
  return 0;
}
long long int substep(long long int stairs) {
  if (stairs < 0) return 0;
  long long int ans;
  ans = (pow(1 + sqrt(5), stairs + 1) - pow(1 - sqrt(5), stairs + 1)) /
        (sqrt(5) * pow(2, stairs + 1));
  return ans;
}
