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

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

  double ret = 1e+60;
  for (int z = 0; z < n; ++z) {
    vector<double> dp(n);
    dp[n - 1] = 0;
    for (int i = n - 2; i >= 0; --i) {
      auto& tos = to[i];
      double max_e = -1;
      double sum_e = 0;
      for (int t : tos) {
        double e = dp[t];
        sum_e += e;
        max_e = max(max_e, e);
      }

      int num = tos.size();
      if (num > 1 && i == z) {
        sum_e -= max_e;
        --num;
      }
      dp[i] = sum_e / num + 1;
    }
    ret = min(ret, dp[0]);
  }
  cout << fixed << setprecision(10) << ret << "\n";

  return 0;
}
