#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

int main() {
	int n, m;
	std::cin >> n >> m;

	std::vector<std::vector<int>> edges(n);
	for (int i = 0; i < m; ++i) {
		int s, t;
		std::cin >> s >> t;
		--s, --t;

		edges[s].push_back(t);
	}

	for (auto&& vec : edges)
		std::sort(vec.begin(), vec.end());

	double ans = n + 1;
	
	std::vector<double> dp(n);
	for (int i = 0; i < n - 1; ++i) {
		std::fill(dp.begin(), dp.end(), 0);

		for (int j = n - 2; j >= 0; --j) {
			auto&& es = edges[j];
			if (es.size() == 1)
				dp[j] = dp[es[0]] + 1;
			else {
				double max = 0;
				int maxIdx = -1;
				for (int k = 0; k < es.size(); ++k) {
					if (dp[es[k]] > max) {
						max = dp[es[k]];
						maxIdx = k;
					}
				}
				for (int k = 0; k < es.size(); ++k)
					if (i != j || k != maxIdx)
						dp[j] += (dp[es[k]] + 1) / (es.size() - (i == j));
			}
		}

		if (dp[0] < ans)
			ans = dp[0];
	}

	std::cout << std::setprecision(10);
	std::cout << ans << std::endl;
}