#include<bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
using LL = long long;
using ULL = unsigned long long;

vector<int> ed[600];
double dp[601] = {};
double dpM[601] = {};
double dpP[601] = {};
int n;

double query(int p) {
	if (p == n) return 0.0;
	if (dp[p] != 0.0) return dp[p];

	dp[p] = 1.0;
	for (auto next : ed[p]) {
		double nextq = query(next);
		dp[p] += nextq / (double)ed[p].size();
		dpM[p] = max(dpM[p], 1.0 + nextq);
	}
	return dp[p];
}

void solve() {
	cin >> n;
	int m; cin >> m;
	rep(i, m) {
		int s, t; cin >> s >> t;
		ed[s].push_back(t);
	}
	for (int i = 1; i < n; i++) query(i);

	dpP[1] = 1.0;
	for (int i = 1; i < n; i++) {
		for (auto next : ed[i]) {
			dpP[next] += dpP[i] / (double)ed[i].size();
		}
	}

	double ans = 0;
	for (int i = 1; i < n; i++) {
		if (ed[i].size() == 1) continue;
		ans = max(ans, dpP[i] * (dpM[i] - dp[i]) / (ed[i].size() - 1));
	}
	cout << setprecision(10) << dp[1] - ans << endl;
}

int main() {

	solve();

	return 0;
}
