#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;

const int N = 600 + 5;
int mp[N][N], n, m;
pair<int, int> node[N * N];
double ans = INT_MAX;
inline void calc (int id) {
	static double dp[N];
	dp[n] = 0;
	per (i, n - 1, 1) {
		dp[i] = 0;
		double mx = -1;
		rep (j, 1, mp[i][0]) {
			int v = mp[i][j];
			if (dp[v] < 0) { dp[i] = -1; break; }
			dp[i] += dp[v];
			mx = max (mx, dp[v]);
		}
		if (dp[i] < 0) continue;
		if (mp[i][0] - (i == id) == 0) dp[i] = -1;
		else {
			if (i == id) dp[i] -= mx;
			dp[i] = (dp[i] / (mp[i][0] * 1.0 - (i == id))) + 1;
		}
	}
	if (dp[1] > 0) ans = min (ans, dp[1]);
}

int main () {
	scanf ("%d%d", &n, &m);
	rep (i, 1, m) {
		int x, y;
		scanf ("%d%d", &x, &y);
		node[i] = {x, y};
		mp[x][ ++mp[x][0] ] = y;
	}
	rep (i, 0, n) {
		calc (i);
	}
	printf ("%.7lf\n", ans);
	return 0;
}