#include <bits/stdc++.h>
using namespace std;
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}
ostringstream oss_global;
string s_global = oss_global.str();
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M, 0);
  for (int i = 1; i <= M; i++) cin >> a[i];
  vector<int> com(N + 1, 0);
  com[1] = 1;
  com[2] = 2;
  for (int i = 3; i <= N; i++) com[i] = com[i - 1] + com[i - 2];
  int ans = 1;
  for (int j = 0; j <= M - 1; j++) {
    int gap = a[j + 1] - a[j] - 1;
    ans = (ans * com[gap]) % 1000000007;
  }
  ans = (ans * com[N - a[M] - 1]) % 1000000007;
  cout << ans << endl;
  return 0;
}
