#include <bits/stdc++.h>
using namespace std;
long long result[100001];
long long fib(long long n) {
  if (n == 0 || n == 1) return result[n] = 1;
  if (result[n] != -1) return result[n];
  return result[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;
}
signed main() {
  long long N, M;
  cin >> N >> M;
  long long a[M];
  long long MOD = 1000000007;
  for (long long i = 0; i < (long long)(M); i++) cin >> a[i];
  for (long long i = 0; i < (long long)(100001); i++) result[i] = -1;
  fib(100000);
  sort(a, a + M);
  for (long long i = 0; i < (long long)(M - 1); i++) {
    if (M == 0) break;
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long res = 1;
  for (long long i = 0; i < (long long)(M); i++) {
    if (i == 0) {
      res = (res * (result[a[i] - 1] % MOD)) % MOD;
    } else {
      res = (res * (result[a[i] - a[i - 1] - 1] % MOD)) % MOD;
    }
  }
  res = (res * (result[N - a[M - 1] - 1] % MOD)) % MOD;
  cout << res % MOD << endl;
  return 0;
}
