n,m=map(int,input().split())
a=[]
for i in range(m):
	a.append(int(input()))
if m>1:
	for i in range(m-1):
		if a[i]+1==a[i+1]:
			print(0)
			exit()
list1=[1,1]
for i in range(n):
	nu=list1[i]+list1[i+1]
	list1.append(nu)
ans=[]
x=a[0]
if x==1:
	ans.append(1)
else:
	ans.append(list1[x-1])
if m>1:
	for i in range(0,m-1):
		x=a[i+1]-a[i]-1
		ans.append(list1[x-1])
x=n-a[-1]
ans.append(list1[x-1])
import functools
import operator
result = functools.reduce(operator.mul, ans)
p,mod=divmod(result, 1000000007)
print(mod)