#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

struct edge {
    ll to, cost;
};

int V;
vector<edge> G[1000000];
ll d[1000000];

void addedge(int st, int ed, ll co) {
    edge e;
    e.to = ed;
    e.cost = co;
    G[st].push_back(e);
}

double base[610];
double prob[610];

int main() {
    cout << fixed;
    cout << setprecision(12);
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    REP(i, 0, M) {
        ll s, t;
        cin >> s >> t;
        s--;
        t--;
        addedge(s, t, 1);
    }
    base[N - 1] = 0;
    PER(i, N - 2, -1) {
        double sum = 0;
        REP(j, 0, G[i].size()) {
            edge e = G[i][j];
            sum += base[e.to];
        }
        sum /= (G[i].size() * 1.0);
        sum += 1;
        base[i] = sum;
    }
    // REP(i, 0, N) {
    //     cout << base[i] << endl;
    // }
    double ans = base[0];
    // cout << ans << endl;
    REP(i, 0, N) {
        if (G[i].size() == 1) {
            continue;
        }
        REP(j, 0, N) {
            prob[j] = base[j];
        }
        ll maxnum = -1;
        double val = -inf;
        REP(j, 0, G[i].size()) {
            edge e = G[i][j];
            if (val < prob[e.to]) {
                val = prob[e.to];
                maxnum = j;
            }
        }
        double sum = 0;
        REP(j, 0, G[i].size()) {
            if (j != maxnum) {
                edge e = G[i][j];
                sum += prob[e.to];
            }
        }
        sum /= ((G[i].size() - 1) * 1.0);
        sum += 1;
        prob[i] = sum;
        PER(j, i - 1, -1) {
            double tmpsum = 0;
            REP(k, 0, G[j].size())
            {
                edge e = G[j][k];
                tmpsum += prob[e.to];
            }
            tmpsum /= (G[j].size() * 1.0);
            tmpsum += 1;
            prob[j] = tmpsum;
        }
        // cout << prob[0] << " " << i << endl;
        if (prob[0] < ans) {
            ans = prob[0];
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 29696