#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB push_back
#define PF push_front
#define FILL(a,b) memset(a,b,sizeof(a))
using namespace std;
double dp[605],p[605];
bool v[605][605];
int n,l[605]; 
int main(){
	int m;
	scanf("%d%d",&n,&m);
	int x,y;
	FOR(i,1,m){
		scanf("%d%d",&x,&y);
		v[x][y]=1;
		l[x]++;
	}
	for(int i=n-1;i>=1;i--){
		FOR(j,i+1,n){
			if(v[i][j])dp[i]+=(dp[j]+1)/l[i];
		}
	}
	double ans=dp[1];
	for(int k=n-1;k>=1;k--){
		if(l[k]==1){
			p[k]=dp[k];continue;
		}
		int maxi=0;
		FOR(i,k+1,n){
			if(dp[i]>dp[maxi]&&v[k][i])maxi=i;
		}
		p[k]=0;
		FOR(i,k+1,n){
			if(i!=maxi&&v[k][i]){
				p[k]+=(dp[i]+1)/(l[k]-1);
			}
		}
		for(int i=k-1;i>=1;i--){
			p[i]=0;
			FOR(j,i+1,n){
				if(v[i][j])p[i]+=(p[j]+1)/l[i];
			}
		}
		ans=min(ans,p[1]);
		p[k]=dp[k];
	}
	printf("%.10f",ans);
	RE 0;
}



