N,M=map(int,input().split())
def steps(N,M):
	if M==0:
		return print(0)
	else:
		a=[]
		for i in range(M):
			a.append(int(input()))
		for i in range(M-1):
			if a[i+1]-a[i]==1:
				return print(0)
		b=[1,1]
		for j in range(N):
			b.append(b[-1]+b[-2])
		ans=1
		a.append(N+1)
		a.insert(0,-1)
		for i in range(M+1):
			c=a[i+1]-a[i]-2
			ans*=(b[c])
		return print(ans%1000000007)
steps(N,M)