n,m=map(int,input().split())
a=[]
for i in range(m):
	a.append(int(input()))



num=[1,1,2]


mod=1000000007

list=[]
count=0
jud=1
ans=1
for i in range(n+1):
	
	if i>2:
		num.append(1)
		num[i]=(num[i-1]+num[i-2])%mod

	if(jud==0 and i in a):
		print("0")
		
		break
	elif i in a:

		#list.append(count-1)
		ans*=num[count-1]%mod
		count=1
		jud=0
	elif(i==n):
		
		ans*=num[count-1]%mod
		#list.append(count-1)
		print(ans%mod)
	else:
		jud=1
		count+=1
