#include <bits/stdc++.h>
using namespace std;
double fib(long long int n) {
  double f =
      (pow((1 + sqrt(5)) / 2, n + 1) - pow((1 - sqrt(5)) / 2, n + 1)) / sqrt(5);
  return llround(f);
}
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<int> broken(M);
  for (int i = 0; i < (int)(M); i++) cin >> broken[i];
  long long int ans = 1;
  if (M >= 2) {
    for (int i = 0; i < (int)(M - 1); i++) {
      ans *= fib(broken[0] + 1);
      if (broken[i + 1] - broken[i] == 1) {
        cout << 0 << endl;
        return 0;
      } else
        ans *= fib(broken[i + 1] - broken[i] - 1);
    }
    ans *= fib(N - broken[M - 1] - 1);
  } else if (M == 1) {
    ans *= fib(broken[0] - 1);
    ans *= fib(N - broken[M - 1] - 1);
  } else
    ans *= fib(N);
  cout << ans % 1000000007 << endl;
}
