#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,(n)) for(ll i=0;i<(n);i++)
int main(){
  ll n,m;
  cin>>n>>m;
  vector<bool> issafe(n,true);
  rep(i,m){
    ll a;cin>>a;
    issafe[a]=false;
  }
  vector<ll> dp(n+1,0);
  dp[0]=1;
  if(issafe[1]) dp[1]=1;
  for(ll i=2;i<n;i++){
    if(issafe[i-1]) dp[i]+=dp[i-1];
    if(issafe[i-2]) dp[i]+=dp[i-2];
    dp[i]%=MOD;
  }
  cout<<dp[n]<<endl;
  
  
  
}