import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); }
void log()(){ writeln(""); } void log(T, A ...)(T t, lazy A a){ if(DEBUG) write(t, " "), log(a); } bool DEBUG = 0; 
string rstring(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T rtype(T)(){ return rstring.to!T; } alias rint = rtype!int, rlong = rtype!long, rreal = rtype!real;
T[] rtypes(T)(int n){ return n.iota.map!(i => rtype!T()).array; } alias rint = rtypes!int, rlong = rtypes!long, rreal = rtypes!real;
T[][] rtypess(T)(int n, int m){ return n.iota.map!(i => rtypes!T(m)).array; } alias rint = rtypess!int, rlong = rtypess!long, rreal = rtypess!real;

// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- //

void solve(){
	int n = rint, m = rint;
	Node[] nodes;
	foreach(i; 0 .. n) nodes ~= new Node(i, i + 1);
	foreach(j; 0 .. m){
		int a = rint - 1, b = rint - 1;
		nodes[a].kids ~= nodes[b];
	}
	log("kids:", nodes.map!(nd => nd.kids.map!(kid => kid.name)));
	
	foreach_reverse(nd; nodes){
		if(nd.id == n - 1) nd.value = 0.0;
		else foreach(kid; nd.kids) nd.value += (kid.value + 1.0) / nd.kids.length.to!real;
	}
	foreach(nd; nodes){
		if(nd.id == 0) nd.weight = 1.0;
		foreach(kid; nd.kids) kid.weight += nd.weight / nd.kids.length.to!real;
	}
	log("value:", nodes.map!(nd => nd.value));
	log("weight:", nodes.map!(nd => nd.weight));
	
	real bestx = 0.0;
	int bestndid, bestkidid;
	foreach(nd; nodes){
		if(nd.kids.length <= 1) continue;
		foreach(kid; nd.kids){
			real x = nd.weight * ((nd.value - (kid.value + 1.0) / nd.kids.length.to!real) 
					* nd.kids.length.to!real / (nd.kids.length - 1).to!real- (kid.value + 1.0))
					/ nd.kids.length.to!real;
			log(nd.name, "->", kid.name, ":", x);
			if(x < bestx){
				bestx = x;
				bestndid = nd.id;
				bestkidid = kid.id;
			}
		}
	}
	log("best:", bestx, bestndid, bestkidid);
	
	writefln("%10.10f", nodes[0].value + bestx);
	
}

class Node{
	int id, name;
	Node[] kids, kids2;
	real value = 0.0;
	real weight = 0.0;
	this(int id, int name){
		this.id = id, this.name = name;
	}
}
