#include<iostream>
using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

int main()
{
	int N;
	cin >> N;
	int M;
	cin >> M;
	int a [M];
	for (int i=0;i<M;++i)cin>>a[i];

	long long dp [100100];
	for (int i=0;i<100100;++i)dp[i]=-1;

	dp[0]=1;
	dp[1]=1;
	for (int i=0;i<M;++i)dp[a[i]]=0;
	for (int i=0;i<100000;++i){
		long long tmp=dp[i+1]+dp[i];
		if(temp>1000000007)temp-=1000000007;
		chmax(dp[i+2],temp);};
	cout<dp[N]<<endl;


}