N , M = map(int, input().split())
A = sorted([int(input()) for _ in range(M)])

Flag = [True for _ in range(N+1)]
for a in A:
    Flag[a] = False

Dp = [0 for _ in range(N+1)]

Dp[0] = 1
Dp[1] = 1
for i in range(N-1):
    if Flag[i+2]:
        Dp[i+2] = (Dp[i] + Dp[i+1])%(10**9+7)
Dp[N]