#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
 
int main() {
  int N, M;  cin >> N >> M;
  Graph E(N);
  int a, b;
  for (int i=0; i < M; i++) {
    cin >> a >> b; a--; b--;
    E.at(a).push_back(b);
  }
  vector<double> p(N, 0); p.at(0) = 1;
  for (int i=0; i < N; i++) {
    for (int x : E.at(i)) {
      p.at(x) += 1.0 * p.at(i) / E.at(i).size();
    }
  }
  vector<double> ex(N, 0); double ans = 0;
  for (int i=N-2; i >= 0; i--) {
    double ex2 = 0, tmp = 0;
    for (int x : E.at(i)) {
      tmp += ex.at(x);
    }
    ex.at(i) = tmp / E.at(i).size() + 1;
    if (E.at(i).size() > 1) {
      for (int x : E.at(i)) {
        ex2 = max(ex2, ex.at(x));
      }
      ex2 = ( tmp - ex2 ) / ( E.at(i).size() - 1) + 1;
      ans = max(ans, p.at(i) * (ex.at(i) - ex2));
    }
  }
  printf("%.8lf\n", ex.at(0) - ans);
}