#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <functional>

using namespace std;
typedef long long int ll;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)
#define MOD 1000000007

int main(){
  ll N, M;
  cin >> N >> M;
  ll broken[N] = {}, dp[N] = {};
  rep(i, M){
    ll a;
    cin >> a;
    broken[a-1] = 1;
  }
  rep(i, N){
    if(broken[i]) continue;
    if(i == 0) dp[i] = 1;
    else if(i == 1) {
      dp[i] = dp[i] + 1;
    }
    else dp[i] = (dp[i-1] + dp[i-2]) % MOD;
  }
  cout << dp[N-1] << endl;
  return 0;
}
