#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
const int MOD = 1000000007;
vector<int> g[101];
int d[101][101];
long long dp1[101][101], dp2[101][101];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) d[i][j] = (i != j) * inf;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    d[x][y] = d[y][x] = 1;
  }
  for (int w = 1; w <= n; ++w)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j) d[i][j] = min(d[i][j], d[i][w] + d[w][j]);
  int dist = d[1][n];
  double ans = 0;
  memset(dp1, 0, sizeof(dp1));
  memset(dp2, 0, sizeof(dp2));
  dp1[0][1] = 1;
  dp2[0][n] = 1;
  for (int len = 1; len <= n; ++len)
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (d[1][j] == len - 1 && d[j][i] == 1) dp1[len][i] += dp1[len - 1][j];
        if (d[j][n] == len - 1 && d[j][i] == 1) dp2[len][i] += dp2[len - 1][j];
      }
    }
  for (int i = 1; i <= n; ++i) {
    long long cur = 0;
    for (int j = 0; j <= (int)(g[i]).size() - 1; ++j) {
      int to = g[i][j];
      for (int len = 0; len <= dist - 1; ++len) {
        cur += dp1[len][i] * dp2[dist - 1 - len][to] +
               dp1[len][to] * dp2[dist - 1 - len][i];
      }
    }
    double tmp = cur / (double)dp1[dist][n];
    ans = max(ans, tmp);
  }
  printf("%.6f\n", ans);
}
