#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<vector<int>> G;
vector<double> dp;

double solve(int k) {
    dp[N - 1] = 0;
    for(int i=N-2; i>=0; --i) {
        double ma = -1;
        dp[i] = 0.0;
        for(int to : G[i]) {
            dp[i] += dp[to];
            if(ma < dp[to]) ma = dp[to];
        }
        if(i == k && G[i].size() > 1) {
            dp[i] = (dp[i] - ma) / (G[i].size() - 1) + 1;
        } else {
            dp[i] = dp[i] / G[i].size() + 1;
        }
    }
    return dp[0];
}

int main() {
    cin >> N >> M;
    G.resize(N); dp.resize(N);
    for(int i=0; i<M; ++i) {
        int s, t; cin >> s >> t;
        G[s - 1].push_back(t - 1);
    }

    double res = solve(N - 1);
    for(int k=N-2; k>=0; --k) {
        res = min(res, solve(k));
    }
    cout << fixed << setprecision(10) << res << endl;
}