#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e16;
const long long MOD = 1e9 + 7;
const long long MAX_N = 1e5 + 10;
long long fib[MAX_N];
void calc_fib(long long n) {
  fib[0] = 1;
  fib[1] = 1;
  for (long long i = 2; i < n + 1; i++) {
    fib[i] = fib[i - 2] + fib[i - 1];
  }
}
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> A(M);
  for (auto& e : A) cin >> e;
  calc_fib(N);
  long long ans = 1;
  long long pos = 0;
  for (long long m = 0; m < M; m++) {
    if (pos == A[m]) {
      cout << 0 << endl;
      return 0;
    }
    ans = ans * fib[A[m] - pos - 1] % MOD;
    pos = A[m] + 1;
  }
  ans = ans * fib[(N + 1) - pos - 1] % MOD;
  cout << ans << endl;
  return 0;
}
