N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1
for i in range(2,N+1):
    if A.count(i) != 0 and A.count(i-1) != 0:
        print(0)
        exit(0)
    if A.count(i) != 0:
        dp[i] = 0
    else:
        dp[i] = dp[i - 1] + dp[i - 2]
#print(dp)
print(dp[N] % 1000000007)
#print(13 % 4)


