#include <bits/stdc++.h>

using namespace std;
const double inf = 1e100;

int n, m;
bool G[600][600];
int C[600];
double P[600];
double E[600];
int main() {
  scanf("%d %d", &n, &m);
  for (int j = 0; j < m; ++j) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a; --b;
    G[a][b] = true;
    ++C[a];
  }
  
  P[0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (!G[i][j]) continue;
      P[j] += P[i] / C[i];
    }
  }
  
  for (int i = n - 2; i >= 0; --i) {
    double sum = 0;
    for (int j = i + 1; j < n; ++j) {
      if (!G[i][j]) continue;
      sum += E[j];
    }
    E[i] = sum / C[i] + 1;
  }
  
  double mn = 0;
  for (int i = 0; i < n; ++i) {
    if (C[i] <= 1) continue;
    for (int j = i + 1; j < n; ++j) {
      if (!G[i][j]) continue;
      double ans = P[i] * (E[i] - E[j] - 1) / (C[i] - 1);
      mn = min(mn, ans);
    }
  }
  printf("%.16f", E[0] + mn);
}
