def ways_to_climb(total_steps, broken_steps):
	steps = [0] * (total_steps + 1)
	steps[1] = 1 if 1 not in broken_steps else 0
	steps[2] = 2 if 2 not in broken_steps else 0

	for i in range(3, len(steps)):
		if i not in broken_steps:
			steps[i] = steps[i - 1] + steps[i - 2]
		else:
			steps[i] = 0

	return steps[-1] % (10**9 + 7)

if __name__ == '__main__':
	n, m = tuple(input().split())
	n = int(n)
	m = int(m)

	broken = set()
	for i in range(m):
		broken.add(int(input()))

	print(ways_to_climb(n, broken))