d = {}

def step(N,M):
	if N == 0:
		return 1
	if N < 0:
		return 0

	if N-1 in d.keys():
		step_1 = d[N-1]
	else:
		step_1 = step(N-1,M)
		d[N-1] = step_1 % 1000000007
	if N-2 in d.keys():
		step_2 = d[N-2]
	else:
		step_2 = step(N-2,M)
		d[N-2] = step_2 % 1000000007
		
	if N - 1 in M and N - 2 in M:
		return 0
	if N - 1 in M:
		return step_2
	if N - 2 in M:
		return step_1
	return (step_1 + step_2) % 1000000007


N, M = map(int, input().split())
a = []
for i in range(M):
	a.append(int(input()))

print(step(N, a))
