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);
    auto D = new int[](N);
    foreach (_; 0..M) {
        s = readln.split.map!(to!int);
        auto u = s[0] - 1;
        auto v = s[1] - 1;
        G[u] ~= v;
        H[v] ~= u;
        D[u] += 1;
    }

    DList!int que;
    foreach (i; H[N-1]) {
        D[i] -= 1;
        if (D[i] == 0) que.insertBack(i);
    }

    auto ans = new real[][](N, 2);
    foreach (i; 0..N) ans[i][] = 1L << 59;
    ans[N-1][0] = 0;

    while (!que.empty) {
        auto u = que.front;
        que.removeFront;
        auto sm = G[u].map!(v => ans[v][0] + 1).sum;
        ans[u][0] = sm / G[u].length;
        ans[u][1] = G[u].map!(v => sm - ans[v][0] + ans[v][1]).reduce!min / G[u].length;
        if (G[u].length > 1) {
            ans[u][1] = min(ans[u][1], G[u].map!(v => sm - ans[v][0] - 1).reduce!min / (G[u].length.to!long - 1));
        }
        foreach (v; H[u]) {
            D[v] -= 1;
            if (D[v] == 0) que.insertBack(v);
        }
    }

    //ans.each!writeln;
    writefln("%.15f", ans.front.reduce!min);
}