N, M = map(int, input().split())  # N段の階段, 壊れている床の個数M

A = []

flag = True
for i in range(M):
    A.append(int(input()))
    if len(A) > 1:
        if A[i] == A[i-1]+1:
            print(0)
            flag = False
            break

dp = [0] * (N+1)
if flag:
    dp[0] = 1
    dp[1] = 1
    for i in range(2, N+1):
        if i-1 not in A:
            dp[i] += dp[i-1]
        if i-2 not in A:
            dp[i] += dp[i-2]

print(dp[-1] % 1000000007)
