N, M = map(int, input().split())
a = list(int(input()) for i in range(M))
DP = [0]*(N+1)

for i in range(N+1):
    if i in a:
        DP[i] = 0
    elif i == 0 or i == 1:
        DP[i] = 1
    else:
        DP[i] = (DP[i-1]+DP[i-2])
print(DP[-1]%1000000007)