#include <bits/stdc++.h>
using namespace std;
template <class T>
void dumplist(T list) {
  for (auto item : list) {
    cout << item << " ";
  }
  cout << endl;
}
void solve() {
  const long long mod = 1000000007;
  long long N, M;
  cin >> N >> M;
  long long fib[100011];
  fib[0] = 1;
  fib[1] = 1;
  for (long long i = (2); i < (100010); i++) {
    fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  }
  long long ans = 1;
  vector<long long> A(M);
  for (long long i = 0; i < (M); i++) {
    cin >> A[i];
  }
  for (long long i = (1); i < (M); i++) {
    if (A[i] + 1 == A[i + 1]) {
      cout << 0 << endl;
    }
  }
  A.push_back(N + 1);
  long long now = 0;
  for (long long a : A) {
    if (a < now) continue;
    long long b = fib[(a - 1) - now];
    ans = ((ans % mod) * (b % mod)) % mod;
    now = a + 1;
  }
  cout << ans << endl;
}
int main() {
  do {
    solve();
  } while (0);
}
