H, W = map(int, input().split())
S = [int(input()) for _ in range(W)]
    
floor = list(range(0,H+1))

if S.count(1) >0:
	floor[1]=0
	floor[2]=1
if S.count(2) >0:
    floor[2]=0

for i in range (3, H+1):
	if S.count(i-2) > 0 and S.count(i-1) > 0:
		floor[i]=0
	elif S.count(i-2) > 0:
		floor[i]=floor[i-1]
	elif S.count(i-1) > 0:
		floor[i]=floor[i-2]
	else:
		floor[i]=floor[i-2]+floor[i-1]
print(floor[H]%(10**9+7))