#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<map>
using namespace std;
const int maxn = 6e2+10;
const int maxm = 36e4+10;

int read(){
	int x=0,f=1;
	char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<3)+(x<<1)+c-48;c=getchar();}
	return x*f;
}

int to[maxm],net[maxm],h[maxn],e=1;
inline void add(int x,int y){
	to[++e]=y;net[e]=h[x];h[x]=e;
}

int k,m,n;
int siz[maxn];
double ans=1e15;
double dp[maxn];
inline void work(int now){
	dp[n]=0;
	double sum,max_;
	for(register int x=n-1;x>=1;x--){
		sum=0;max_=0;
		for(register int i=h[x];i;i=net[i]){
			int y=to[i];
			sum+=dp[y];
			max_=max(max_,dp[y]);
		}
		if(now==x && siz[x]>=2){
			sum-=max_;
			dp[x]=sum/(siz[x]-1)+1;
		}
		else dp[x]=sum/siz[x]+1;
	}
	ans=min(ans,dp[1]);
}

int main(){
	n=read();m=read();
	for(register int i=1;i<=m;i++){
		int x=read(),y=read();
		siz[x]++;
		add(x,y);
	}
	for(register int i=0;i<n;i++)work(i);
	printf("%.8lf\n",ans);
	return 0;
}