#include <bits/stdc++.h>
using namespace std;
long long calc(long long k) {
  long long r = 1;
  for (long long i = 1; i <= k; ++i) {
    r *= i;
  }
  return r;
}
int main() {
  vector<long long> A;
  vector<long long> step;
  long long N;
  long long M;
  long long preStep = 0;
  cin >> N;
  cin >> M;
  long long sumCount = 1;
  for (long long i = 0; i <= M; ++i) {
    long long stepCount = 0;
    vector<long long> count;
    count.push_back(1);
    count.push_back(1);
    long long step;
    if (i == M) {
      step = N + 1;
    } else {
      cin >> step;
    }
    if (step == preStep) {
      cout << 0 << endl;
      return 0;
    }
    for (long long j = preStep; j < step; ++j) {
      if (stepCount <= 1) {
        ++stepCount;
      } else {
        count.push_back((count[count.size() - 2] + count[count.size() - 1]) %
                        1000000007);
      }
    }
    sumCount *= count[count.size() - 1] % 1000000007;
    preStep = step + 1;
  }
  cout << sumCount % 1000000007 << endl;
  return 0;
}
