N, M = gets.split.map(&:to_i)
STs = readlines.map{|l| l.split.map(&:to_i)}

fs, ts, ns = Array.new(N + 1){[]}, Array.new(N + 1){[]}, Array.new(N + 1, 0)
STs.each{|s, t| fs[s] << t; ts[t] << s; ns[s] += 1}
ev = Array.new(N + 1, 0.0)
(N - 1).downto(1).each do |i|
  ev[i] = fs[i].inject(0){|s, j| s + ev[j] + 1} / ns[i]
end
wt = Array.new(N + 1, 1.0)
(2 .. N).each do |j|
  wt[j] = ts[j].inject(0){|s, i| s + wt[i] / ns[i]}
end
d = (1 .. N).select{|i| ns[i] > 1}.map do |i|
  k = fs[i].max_by{|j| ev[j]}
  n = ns[i]
  fs[i].inject(0){|s, j| s + ev[j] / (j == k ? n : n*(1 - n))}*wt[i]
end.max || 0
puts ev[1] - d