#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
void *wmem;
char memarr[96000000];
template<class T> inline void walloc1d(T **arr, int x, void **mem = &wmem){
  static int skip[16] = {0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  (*mem) = (void*)( ((char*)(*mem)) + skip[((unsigned long long)(*mem)) & 15] );
  (*arr)=(T*)(*mem);
  (*mem)=((*arr)+x);
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(double x){
  printf("%.15f",x);
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
struct graph{
  int N;
  int *es;
  int **edge;
  void setDirectEdge(int N__, int M, int A[], int B[], void **mem = &wmem){
    int i;
    N = N__;
    walloc1d(&es, N, mem);
    walloc1d(&edge, N, mem);
    walloc1d(&edge[0], M, mem);
    for(i=(0);i<(N);i++){
      es[i] = 0;
    }
    for(i=(0);i<(M);i++){
      es[A[i]]++;
    }
    for(i=(0);i<(N);i++){
      walloc1d(&edge[i], es[i], mem);
    }
    for(i=(0);i<(N);i++){
      es[i] = 0;
    }
    for(i=(0);i<(M);i++){
      edge[A[i]][es[A[i]]++] = B[i];
    }
  }
}
;
int N;
int M;
int A[400000];
int B[400000];
double dp[600];
double p[600];
int main(){
  int i;
  wmem = memarr;
  double mx = 0;
  double tmp;
  double s;
  double m;
  graph g;
  rd(N);
  rd(M);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=(0);Lj4PdHRW<(M);Lj4PdHRW++){
      rd(A[Lj4PdHRW]);A[Lj4PdHRW] += (-1);
      rd(B[Lj4PdHRW]);B[Lj4PdHRW] += (-1);
    }
  }
  g.setDirectEdge(N,M,A,B);
  p[0] = 1;
  for(i=(0);i<(N);i++){
    int KL2GvlyY;
    for(KL2GvlyY=(0);KL2GvlyY<(g.es[i]);KL2GvlyY++){
      auto &j = g.edge[i][KL2GvlyY];
      p[j] += p[i] / g.es[i];
    }
  }
  for(i=(N-1)-1;i>=(0);i--){
    int Q5VJL1cS;
    for(Q5VJL1cS=(0);Q5VJL1cS<(g.es[i]);Q5VJL1cS++){
      auto &j = g.edge[i][Q5VJL1cS];
      dp[i] += dp[j];
    }
    dp[i] = dp[i] / g.es[i] + 1;
  }
  for(i=(0);i<(N);i++){
    if(g.es[i] > 1){
      int e98WHCEY;
      s = m = 0;
      for(e98WHCEY=(0);e98WHCEY<(g.es[i]);e98WHCEY++){
        auto &j = g.edge[i][e98WHCEY];
        s += dp[j];
        chmax(m, dp[j]);
      }
      chmax(mx, p[i] * (s/g.es[i] - (s-m)/(g.es[i]-1)));
    }
  }
  wt_L(dp[0] - mx);
  wt_L('\n');
  return 0;
}
// cLay varsion 20191027-1

// --- original code ---
// int N, M, A[4d5], B[4d5];
// double dp[600], p[600];
// 
// {
//   double mx = 0, tmp, s, m;
//   graph g;
//   rd(N,M,(A--,B--)(M));
//   g.setDirectEdge(N,M,A,B);
// 
//   p[0] = 1;
//   rep(i,N) rep[g.edge[i]](j,g.es[i]) p[j] += p[i] / g.es[i];
//   rrep(i,N-1){
//     rep[g.edge[i]](j,g.es[i]) dp[i] += dp[j];
//     dp[i] = dp[i] / g.es[i] + 1;
//   }
// 
//   rep(i,N) if(g.es[i] > 1){
//     s = m = 0;
//     rep[g.edge[i]](j,g.es[i]){
//       s += dp[j];
//       m >?= dp[j];
//     }
//     mx >?= p[i] * (s/g.es[i] - (s-m)/(g.es[i]-1));
//   }
// 
//   wt(dp[0] - mx);
// }


Measured memory_bytes: 5504