#include <bits/stdc++.h>
using namespace std;
const long long N = 101;
long long dis[N];
long long vis[N];
long long dp[N], kp[N];
vector<long long> g[N];
long long fnc(long long x) {
  if (x == 1) return 1;
  long long &ans = dp[x];
  if (ans != -1) return ans;
  ans = 0;
  for (long long y : g[x]) {
    if (dis[y] == dis[x] - 1) ans = ans + fnc(y);
  }
  return ans;
}
long long pw;
long long gnc(long long x) {
  if (x == 1) return 0;
  long long &ans = kp[x];
  if (ans != -1) return ans;
  ans = 0;
  for (long long y : g[x]) {
    long long c = 0;
    if (y == pw or x == pw) c = 1;
    if (dis[y] == dis[x] - 1) ans = ans + fnc(y) * c + gnc(y);
  }
  return ans;
}
signed main() {
  long long n, m, x, y;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  queue<long long> q;
  q.push(1);
  dis[1] = 0;
  vis[1] = 1;
  while (!q.empty()) {
    long long p = q.front();
    q.pop();
    for (long long y : g[p]) {
      if (vis[y] == 0) {
        dis[y] = dis[p] + 1;
        vis[y] = 1;
        q.push(y);
      }
    }
  }
  memset(dp, -1, sizeof(dp));
  long long tot = fnc(n);
  long long val = 0;
  for (long long i = 1; i <= n; i++) {
    memset(kp, -1, sizeof(kp));
    pw = i;
    val = max(val, gnc(n));
  }
  double ans = (val * 1.0) / tot;
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
