#include <bits/stdc++.h>
using namespace std;
long long fib(long long n) {
  n++;
  double tmp;
  long long ans;
  tmp = {pow((1 + sqrt(5)) / 2, n) - pow((1 - sqrt(5)) / 2, n)};
  tmp /= sqrt(5);
  ans = {static_cast<long long>(tmp)};
  return ans;
}
int main() {
  bool flag = true;
  long long n, m, ans;
  cin >> n >> m;
  vector<int> a(m);
  cin >> a[0];
  for (int i = 1; i < m; i++) {
    cin >> a[i];
    if (a[i] - a[i - 1] == 1) {
      flag = false;
      break;
    }
  }
  if (m != 0) {
    ans = fib(a[0] - 1) % 1000000007;
    for (int i = 1; i < m; i++) {
      ans *= fib(a[i] - a[i - 1] - 2) % 1000000007;
    }
    ans *= fib(n - a[m - 1] - 1) % 1000000007;
    if (flag == true)
      cout << ans % 1000000007 << endl;
    else
      cout << 0 << endl;
  } else {
    cout << fib(n) % 1000000007 << endl;
  }
  return 0;
}
