N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
INF = 1000000007
a = list(set(a))

ans, start = 1, 0

x = [1] * (N + 1)  #x[i]は0からiまでの階段の移動方法の数
x[0], x[1] = 1, 1
for i in range(2, N + 1):
	x[i] = (x[i - 1] + x[i - 2]) % INF

for j in range(1, M):
	if a[j] - a[j - 1] == 1:
		print(0)
		exit()

for k in range(N):
	if k in a:
		# print("hit")
		ans *= x[k - 1 - start]
		ans %= INF
		start = k + 1
	# print(k, "now", ans)
ans *= x[N - start]
print(ans % INF)
