import sys

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



num=[1,1,2]

for i in range(3,n+1):
	num.append(1)
	num[i]=num[i-1]+num[i-2]

mod=1000000007

list=[]
count=0
y=1
ans=1
b=0
for i in range(n):
	if(y==0 and i in a):
		print("0")
		b=1
		break
	elif i in a:

		list.append(count-1)

		count=1
		y=0
	elif(i==n-1):
		count+=1
		y=1
		list.append(count-1)
		
		
	else:
		y=1
		count+=1

if(b==0):
	for j in range(len(list)):
		ans=((ans%mod)*(num[list[j]]%mod))%mod
		
	print(ans%mod)
