#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long modpow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> sum(2 * n);
  sum[0] = 0;
  sum[1] = sum[2] = 1;
  for (long long i = 3; i < 2 * n; i++) {
    sum[i] = (sum[i - 1] + sum[i - 2]) % mod;
  }
  long long ans = sum[a[0]] % mod;
  for (long long i = 1; i < m; i++) {
    ans = (ans * sum[a[i] - a[i - 1] - 1]) % mod;
  }
  ans = (ans * (sum[n - a[m - 1]])) % mod;
  cout << ans % mod << endl;
  return 0;
}
