n,m = map(int,input().split())
A = [int(input()) for i in range(m)]+[n+1]

cur_step = 0
steps = []
ans = 1
for a in A:
	if a-cur_step == 0:
		ans = -1
		break
	if a == 1:
		steps.append(1)
		cur_step = 2
		continue
	steps.append(a-1-cur_step)
	cur_step = a+1
# print(steps)
#ごり押しパターン計算
pat = [1,2]
inf = 10**9+7
while len(pat) < max(steps):
	pat.append((pat[-1]+pat[-2])%inf)

if ans == -1:
	print(0)
else:
	for step in steps:
		ans = (ans*pat[step-1])%inf
	print(ans)