import numpy as np
N , M = map(int,input().split())
ans = np.full(N+1,-1)
ans[0] = 1
for i in range(M):
	ans[int(input())] = 0
if ans[1] == -1:
	ans[1] = 1
for i in range(N-1):
	if ans[i+2] == -1:
		ans[i+2] = (ans[i+1] + ans[i]) % 1000000007
print(ans[N] % 1000000007)
	
