#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<utility>
#include<functional>
#include<algorithm>
#include<bitset>
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define r0 return 0
const int mod=1000000007;
long long n,m,k,i,a[100005],ans;
set<long long>st;
int main()
{
	cin>>n>>m;
	for(int i=0;i<m;i++)
		cin>>k,st.insert(k);
	a[1]=1;
	a[2]=2;
	a[3]=3;
	if(st.count(1))
		a[1]=0,a[2]=1,a[3]=1;
	if(st.count(2))
		a[1]=1,a[2]=0,a[3]=1;
	if(st.count(3))
		a[1]=1,a[3]=0;
	for(i=4;i<=n;i++)
		if(!st.count(i))
			a[i]=(a[i-1]%mod+a[i-2]%mod)%mod;
	cout<<a[n];
	r0;
}