#include <bits/stdc++.h>
using namespace std;
using intpair = pair<long long, long long>;
long long mod = 1e9 + 7;
signed main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> broken(M + 1);
  for (long long i = 0; i < (long long)(M); i++) cin >> broken[i];
  ;
  broken[M] = N + 1;
  for (long long i = 0; i < (long long)(M - 1); i++) {
    if (broken[i] + 1 == broken[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long> F(1e5 + 1);
  F[0] = F[1] = F[2] = 1;
  for (long long i = (long long)(3); i <= (long long)(1e5); i++)
    F[i] = (F[i - 1] + F[i - 2]) % mod;
  long long res = F[broken[0]] % mod;
  for (long long i = 0; i < (long long)(M); i++) {
    long long steps = F[broken[i + 1] - broken[i] - 1];
    res = (res * steps) % mod;
  }
  cout << res << endl;
  return 0;
}
