#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MOD = 1000000007;
vector<long long> fib(100001);
long long mod_fib(int n) {
  if (fib[n] != 0) return fib[n];
  if (n == 0 || n == 1) return n;
  return fib[n] = (mod_fib(n - 1) + mod_fib(n - 2)) % MOD;
}
int main(int argc, char *argv[]) {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)M; ++i) cin >> a[i];
  vector<pair<int, int>> range(M + 1);
  for (int i = 0; i < (int)M + 1; ++i) {
    if (i == 0)
      range[i] = make_pair(0, a[i] - 1);
    else if (i == M)
      range[i] = make_pair(a[i - 1] + 1, N);
    else
      range[i] = make_pair(a[i - 1] + 1, a[i] - 1);
  }
  long long ans = 1;
  for (int i = 0; i < (int)range.size(); ++i) {
    ans *= mod_fib(range[i].second - range[i].first + 1);
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
