#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;

int n, m;
vector<int> adj[666];

double cache[666][666];

double dp(int v, int b) {
  if(v == n) return 0;
  if(adj[v].size() == 0) return 1e18;
  if(cache[v][b] != 0) return cache[v][b];

  vector<double> e;
  int d = adj[v].size();
  for(int u : adj[v]) {
    e.push_back(dp(u, b));
  }

  if(v == b) {
    sort(e.begin(), e.end());
    e.pop_back();
    d--;
  }

  double res = 0;
  for(double t : e) res += t;
  res /= d;
  res += 1.0;

  return cache[v][b] = res;
}

int main(int argc, char **argv) {
#ifdef LOCAL
  freopen("in.txt", "r", stdin);
#endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);

  cin >> n >> m;
  for(int i=0; i<m; i++) {
    int x, y; cin >> x >> y;
    adj[x].push_back(y);
  }

  double res = 1e18;
  for(int i=0; i<=n; i++) {
    if(adj[i].size() == 1) continue;
    double t = dp(1, i);
    res = min(res, t);
  }

  cout.precision(9);
  cout << fixed;
  cout << res << endl;

  return 0;
}