#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<vector<int>> e(n);
  for (int i = 0; i < m; i++) {
    int s, t;
    scanf("%d %d", &s, &t);
    e[s - 1].emplace_back(t - 1);
  }

  double ans = n - 1;
  for (int i = 0; i + 1 < n; i++) {
    if (e[i].size() < 2) continue;

    vector<double> f(n);
    f[n - 1] = 0;
    for (int j = n - 2; j >= 0; j--) {
      double s = 0, maxp = 0; 
      for (int k = 0; k < e[j].size(); k++) {
        double v = f[e[j][k]];
        s += v;
        maxp = max(v, maxp);
      }
      if (j == i)
        f[j] = (s - maxp) / (e[j].size() - 1) + 1;
      else
        f[j] = s / e[j].size() + 1;
    }

    ans = min(f[0], ans);
  }
  printf("%lf\n", ans);

  return 0;
}