#include <bits/stdc++.h>
using namespace std;
long long mod = (long long)1e9 + 7;
long long INF = (long long)2e18;
long long fib[100005];
long long mul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
signed main() {
  fib[0] = 1;
  fib[1] = 1;
  for (long long i = 2; i <= 100003; i++) {
    fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  }
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) cin >> a[i];
  for (long long i = 0; i < M - 1; i++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long ans = 1;
  if (M == 0) {
    cout << fib[N] << endl;
    return 0;
  }
  for (long long i = 0; i <= M; i++) {
    if (i == M) {
      ans = mul(ans, fib[N - a[i - 1] - 1]);
    } else if (i == 0) {
      ans = mul(ans, fib[a[0]]);
    } else {
      ans = mul(ans, fib[a[i] - a[i - 1] - 2]);
    }
  }
  cout << ans << endl;
}
