#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
 
#define mem(dp,a)       memset(dp,a,sizeof dp)
#define ninja           ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb(x)           push_back(x)
#define mp(x,y)         make_pair(x,y)
#define all(c)          c.begin(), c.end()
#define ff              first
#define ss              second
#define nl              '\n'
#define inf             1e9+7
 
int main()
{
	ninja
	int t; //cin>>t;
	t=1;
	while(t--)
	{
		ll n,m; cin>>n>>m;
		ll x;
		ll mod=1e9+7;
		vector<bool> broken(n+1,false);
		for(ll i=0;i<m;i++)
			{cin>>x; broken[x]=1;}

		vector<ll> dp(n+1,0);
		dp[0]=1;
		if(broken[1])dp[1]=0;
		else dp[1]=1;
		for(ll i=2;i<=n;i++){
			if(!broken[i])
			{
				dp[i]+=((d[i-1]+dp[i-2])%mod);
			}
		}
		cout<<dp[n];
	}
}

