#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, A, F[100009] = {};
  long long ans = 1;
  cin >> n >> m;
  F[1] = 1;
  for (int i = 2; i <= n + 3; i++) {
    F[i] = (F[i - 1] + F[i - 2]) % 1000000007;
  }
  vector<int> a;
  for (int i = 0; i < m; i++) {
    cin >> A;
    a.push_back(A);
    if (i == 0) {
      ans = F[A];
    } else {
      ans = (ans * F[A - a[i - 1] - 1]) % 1000000007;
    }
  }
  ans = (ans * F[n - A]) % 1000000007;
  cout << ans << endl;
}
