#include <bits/stdc++.h>

using namespace std;

template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}

class Solution {
public:
	void solve() {
		int n, m;
		cin >> n >> m;
		vector<vector<int>> a(n);
		for(int i=0; i < m; i++){
			int s, t;
			cin >> s >> t;
			s--, t--;
			a[s].emplace_back(t);
		}
		vector<double> e(n, 0), p(n, 0);
		for(int i=n-2; i >= 0; i--){
			for(auto x: a[i])e[i] += e[x] + 1;
			e[i] /= a[i].size();
		}
		p[0] = 1.0;
		for(int i=0; i < n; i++){
			for(auto x: a[i]){
				p[x] += p[i]/a[i].size();
			}
		}
		double d = 0.0;
		for(int i=0; i < n; i++){
			if(a[i].size()==1)continue;
			double s = 0.0;
			double f = 0.0;
			for(auto x: a[i]){
				s += e[x];
				updmax(f, e[x]);
			}
			updmax(d, p[i] * (-s+a[i].size()*f)/(a[i].size()*(a[i].size()-1)));
		}
		cout << setprecision(12) <<e[0]-d << endl;
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}