import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto G = new int[][](N);
    auto H = new int[][](N);
    foreach (i; 0..M) {
        s = readln.split.map!(to!int);
        auto u = s[0] - 1;
        auto v = s[1] - 1;
        G[u] ~= v;
        H[v] ~= u;
    }

    auto dp = new real[](N);
    dp[] = 0;

    foreach_reverse (i; 0..N-1) {
        dp[i] = G[i].map!(j => dp[j]).sum / G[i].length + 1;
    }

    real ans = dp[0];

    foreach (i; 0..N-1) if (G[i].length > 1) {
        auto ep = dp.dup;
        ep[i] = (G[i].map!(i => dp[i]).sum - G[i].map!(i => dp[i]).reduce!max) / (G[i].length.to!long - 1) + 1;
        foreach_reverse (j; 0..i) {
            ep[j] = G[j].map!(k => ep[k]).sum / G[j].length + 1;
        }
        ans = min(ans, ep[0]);
    }

    writefln("%.15f", ans);
}
