#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
using namespace std;
using ll = long long;

int main() {
  int N, M;
  cin >> N >> M;

  ll mod = 1'000'000'007;
  vector<ll> fibo(N);
  fibo[0] = 1; fibo[1] = 1;
  rep(i,2,N-1) {
    fibo[i] = fibo[i-2] % mod + fibo[i-1] % mod;
    fibo[i] = fibo[i] % mod;
  }


  int cur = 0;
  vector<ll> v(M+1);
  rep(i,0,M-1) {
    int a;
    cin >> a;
    if (a == cur) {
      cout << 0 << endl;
      return 0;
    }
    v[i] = fibo[a - (cur + 1)];
    cur = a + 1;
  }

  v.back() = fibo[N - cur];

  ll ans = 1;
  for (ll n : v) {
    ans *= n;
    ans %= mod;
  }

  cout << ans << endl;
  return 0;
}
