import sys
inputs = sys.stdin.readline
def main():
	ans = 1
	a = 0
	b = 0
	N, M = map(int,inputs().split())
	for i in range(M):
		a = int(inputs())
		ans = ans*count(a - b -1)
		b = a+1
	if a == N - 1:
		print(ans%1000000007)
	else:
		print(ans*count(N - a-1)%1000000007)


def count(x):
	if x < 0:
		return 0
	elif x == 0:
		return 1
	elif x == 1:
		return 1
	elif x == 2:
		return 2
	else:
		return(count(x-1)+count(x-2))

main()