def min(a,b); a < b ? a : b; end
def max(a,b); a > b ? a : b; end

N, M = gets.split.map(&:to_i)
G = Array.new(N + 1){ [] }

Q = Array.new(N + 1, 0.0); Q[1] = 1.0
dp = 2.times.map{ Array.new(N + 1, 0.0) } 

M.times do
  s,t = gets.split.map(&:to_i)
  G[s] << t
end

(1 ... N).reverse_each do |s|
  dmax = 0.0
  sum = 0.0
  
  G[s].each do |t| 
    sum += dp[0][t]
    dmax = max(dp[0][t], dmax)
  end

  dp[0][s] = sum / G[s].size + 1.0

  if G[s].size == 1
    dp[1][s] = dp[0][s]
  else
    dp[1][s] = (sum - dmax) / (G[s].size - 1) + 1.0
  end
end

(1 ... N).each do |s|
  q = Q[s] / G[s].size
  G[s].each{|t| Q[t] += q }
end

ans = (1 ... N).inject(dp[0][1]) do |d_, s|
  min(d_, dp[0][1] + Q[s] * (dp[1][s] - dp[0][s]))
end

puts ans
