import sys

stdin = sys.stdin

ni = lambda: int(ns()) #int
na = lambda: list(map(int, stdin.readline().split())) #int,list
ns = lambda: stdin.readline().rstrip()  # str


def dp(n):
	v=[1,1,2]
	for i in range(n):
		v.append(v[i+1]+v[i+2])
	return v

n,m=na()
dp = dp(n)
#print(dp[0:10])
ans=1
flag=0
a=[-1]
for i in range(m):
	a.append(ni())

for i in range(m):
	
	#print(a)
	if (a[i+1]-a[i]==1):
		flag=1
		break
	ans*=dp[a[i+1]-a[i]-2]

print((ans*(n-a[-1]-1))%1000000007)

