N, M = gets.split.map(&:to_i)
edges = Array.new(N){[]}
M.times do
    a, b = gets.split.map(&:to_i)
    edges[a-1].push(b-1)
end

ans = 1e18
dp = Array.new(N, 0.0)
(N-1).times do |s|
    (s==0 ? N-2 : s).downto(0) do |i|
        sum = 0.0
        mx = 0.0
        edges[i].each do |j|
            sum += dp[j]
            mx = dp[j] if mx < dp[j]
        end
        sz = edges[i].size
        if i == s && sz > 1
            dp[i] = 1 + (sum-mx)/(sz-1)
        else
            dp[i] = 1 + sum/sz
        end
    end
    ans = dp[0] if ans > dp[0]
end
puts ans