N,M = list(map(int,input().split()))
a = [int(input()) for i in range(M)]
dekai = 1000000007
 
def Fib(n):
	a,b = 0,1
	if n == 1:
		return a
	elif n == 2:
		return b
	else:
		for i in range(n-2):
			a,b = b,a+b
		return b


ans = 1
for i in range(M+1):
	if i == 0:
		ans = ans*Fib(a[0]-(-1))%dekai
	elif i == M:
		ans = ans*Fib(N+1-a[M-1])%dekai
	else:
		ans = ans*Fib(a[i]-a[i-1])%dekai
print(ans)