const MOD = Int(10^9+7)

function solve()
    N, M = parse.(Int, split(readline()))
    a = zeros(Int, M)
    for i = 1:M
        a[i] = parse(Int, readline())
    end

    if N == 1
        println(1)
        return 0
    end

    dp = zeros(Int, N)
    dp[1] = 1
    dp[2] = 2

    for i = 1:M dp[a[i]] = -1 end

    for i = 2:N
        println(dp)
        if dp[i] < 0 continue end

        if i + 1 <= N
            if dp[i+1] >= 0
                dp[i+1] = (dp[i+1] + dp[i])%MOD
            end
        end

        if i + 2 <= N
            if dp[i+2] >= 0
                dp[i+2] = (dp[i+2] + dp[i])%MOD
            end
        end
    end

    println(dp[N])
end

solve()
