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

num=[1,1,2]

mod=1000000007

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 a[i]==1):
		print("0")
		break
	elif(i==n):
		count+=1
		ans=(ans%mod)*(num[count-1]%mod)
		
		print(ans%mod)
	elif a[i]==1:
		
		ans=(ans%mod)*(num[count-1]%mod)
		count=0
		jud=0
	else:
		jud=1
		count+=1