n,m=map(int,input().split())
a=[0]*m
for i in range(m):
	a[i]=int(input())
	
def pattern(n):
	if n==0:
		return 1
	if n==1:
		return 1
	return pattern(n-1)+pattern(n-2)

def renzoku(m):
	total=0
	for i in range(m-1):
		if a[i]==a[i+1]-1:
			total=1
			break;
	return total
	
if renzoku(m):
	print(0)
	
elif m==0:
	print(pattern(n))
	
else:
	total=pattern(n-a[m-1]-1)*pattern(a[0]-1)%1000000007
	for i in range(m-1):
		total*=pattern(a[i+1]-a[i]-2)
	print(total%1000000007)