#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n, m; cin >> n >> m;
  VV<> g(n);
  while (m--) {
    int s, t; cin >> s >> t, --s, --t;
    g[s].push_back(t);
  }
  long double res = 1e100;
  for (int x = n - 1; x >= 0; --x) if (x == n - 1 or g[x].size() >= 2) {
    V<long double> dp(n);
    for (int v = n - 2; v >= 0; --v) {
      if (v != x) {
        for (int u : g[v]) {
          dp[v] += dp[u];
        }
        dp[v] /= g[v].size();
      } else {
        long double mx = 0;
        for (int u : g[v]) {
          dp[v] += dp[u];
          mx = max(mx, dp[u]);
        }
        dp[v] -= mx;
        dp[v] /= g[v].size() - 1;
      }
      dp[v] += 1;
    }
    res = min(res, dp[0]);
  }
  cout << fixed << setprecision(15) << res << '\n';
}