N, M = map(int, input().split())
if N == 1:
    print(0 if M == 1 else 1)
    exit()

dp = [0] * N
dp[N - 1] = 1
dp[N - 2] = 1
lst = [int(input()) for _ in range(M)]

for x in reversed(range(N -2)):
    if x + 1 in lst:
        dp[x] = 0
    else:
        dp[x] = dp[x + 1] + dp[x + 2]

print(dp[0] + dp[1] % 1000000007)
