MOD = 10 ** 9 + 7

def solve():
    N, M = map(int, input().split())
    A = [int(input()) for _ in range(M)]
    
    if N == 1 and M == 0:
        return 1
    elif N == 1 and M == 1 and A[0] == 0:
        return 0

    dp = [0 for i in range(N+1)]
    dp[1] = 0 if 1 in A else 1
    dp[2] = 0 if 2 in A else dp[1] + 1

    for i in range(3, N+1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = dp[i-1] + dp[i-2]
            dp[i] %= MOD

    return dp[N] % MOD

print(solve())