#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
  chrono::system_clock::time_point start, end;
  start = chrono::system_clock::now();
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (m == 0) {
    cout << n << endl;
    return 0;
  }
  vector<int> a(m + 2);
  a.at(0) = -1;
  a.at(m + 1) = n + 1;
  for (int i = 1; i <= m; i++) {
    cin >> a.at(i);
  }
  for (int i = 1; i <= m - 1; i++) {
    if (a.at(i + 1) == a.at(i) + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<unsigned long long> fibo(n + 1, 1);
  for (int i = 0; i < n - 1; i++) {
    fibo.at(i + 2) = fibo.at(i) + fibo.at(i + 1);
    fibo.at(i + 2) %= (int)1e+9 + 7;
  }
  unsigned long long ans = 1;
  for (int i = 0; i < m + 1; i++) {
    int len = a.at(i + 1) - a.at(i) - 2;
    ans *= fibo.at(len);
    ans %= (int)1e+9 + 7;
  }
  cout << ans << endl;
  return 0;
}
