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

vector<int> g[606];
double dp[606];
double ans;
int main() {
  int n,m;
  cin >> n >> m;
  for(int i = 0; i < m; i++) {
    int s,t;
    cin >> s >> t;
    --s; --t;
    g[s].push_back(t);
  }

  for(int i = n - 2; i >= 0; i--) {
    double p = 1 / (double) g[i].size();
    double tmp = 0;
    for(int j = 0; j < g[i].size(); j++) {
      tmp += p * dp[g[i][j]];
    }
    dp[i] = tmp + 1;
  }

  ans = dp[0];
  
  for(int i = 0; i < n; i++) {
    vector<double> dp2(n,0);
  
    for(int j = n - 2; j >= 0; j--) {
      int nn = g[j].size();
      double tt = 0;
      double ma = 0;
      for(int k = 0; k < g[j].size(); k++) {
	tt += dp2[g[j][k]];
	ma = max(ma,dp2[g[j][k]]);
      }
      if(i == j && nn >= 2) {
	nn--;
	tt -= ma;
      }
      dp2[j] = tt / nn + 1;
    }
    if((i == 0 && g[i].size() == 1) || dp2[0] == 1) continue;
    ans = min(ans,dp2[0]);
  }

  cout << setprecision(10) << ans << endl;
}
