#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  long long mmry = 0;
  if (a.at(0) == 1) {
    mmry = 1;
  } else {
    mmry = a.at(0) - 1;
  }
  vector<long long> b(M);
  b.at(0) = mmry;
  for (long long i = 1; i < M; i++) {
    b.at(i) = a.at(i) - a.at(i - 1) - 2;
  }
  b.push_back(N - a.at(M - 1) - 1);
  sort(b.begin(), b.end());
  long long minnn = b.at(0);
  reverse(b.begin(), b.end());
  long long maxxx = b.at(0);
  mp[0] = 0;
  mp[1] = 1;
  mp[2] = 2;
  for (long long i = 3; i <= maxxx; i++) {
    mp[i] = mp[i - 1] + mp[i - 2];
  }
  if (minnn > 0) {
    long long ans = 1;
    for (long long i = 0; i < M + 1; i++) {
      ans *= mp[b.at(i)];
    }
    cout << ans % 1000000007 << endl;
  } else {
    cout << 0 << endl;
  }
}
