def min(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
D = Array.new(N + 1, 0.0)

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

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

dmin = 0.0
(1 ... N).reverse_each do |s|
  d = G[s].inject(0.0){|sum, t| sum + D[t] }
  D[s] = d / G[s].size + 1.0
  
  next unless G[s].size > 1
  G[s].each do |t|
    dmin = min(dmin, ((d - D[t]) / (G[s].size - 1) - d / G[s].size) * Q[s])
  end
end

puts D[1] + dmin
