#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
int main(){
    int n,m,c=0;
    cin>>n>>m;
  	rep(i,0,m)cin>>a[i];
    ll dp[10010];
  	rep(i,0,n+1)dp[i]=0;
    dp[0]=1;
    if(m>0&&a[0]==1){
		c++;
      	dp[1]=0;
    }else dp[1]=1;
    rep(i,2,n+1){
        if(i==a[c]){
			c++;
          	dp[i]=0;
        }else{
            dp[i]+=dp[i-1]+dp[i-2];
            dp[i]%=MOD;
        }
    }
    cout<<dp[n]<<endl;
}