import sys

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

print(a)
#while True:
#    try:
#        i = list(map(int, input().split()))
#        a += i
 #   except EOFError:
 #       break

num=[0,0,1,2]

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

#print(num)

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

		count=1
		y=0
	elif(i==n-1):
		count+=1
		y=1
		list.append(count-1)
		#print(list)
		for j in range(len(list)):
			ans=ans*num[list[j]+1]
	else:
		y=1
		count+=1
print(ans%1000000007)

