### BUGGY CODE ###

#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,m = LI()
    v = [[] for i in range(n)]
    v_ = [[] for i in range(n)]
    for i in range(m):
        a,b = LI()
        a -= 1
        b -= 1
        v[a].append(b)
        v_[b].append(a)
    dp_ = [0]*n
    for y in range(1,n)[::-1]:
        d = dp_[y]
        for x in v_[y]:
            dp_[x] += (d+1)/len(v[x])
    ans = dp_[0]
    for a in range(n-1):
        if len(v[a]) == 1:
            continue
        m = max([dp_[b] for b in v[a]])
        for b in v[a]:
            if dp_[b] == m:
                break
        dp = [dp_[i] if i > a else 0 for i in range(n)]
        for y in range(1,n)[::-1]:
            d = dp[y]
            for x in v_[y]:
                if x > a:
                    continue
                if (x,y) == (a,b):
                    continue
                dp[x] += (d+1)/(len(v[x])-(a == x))
        if 0 < dp[0] < ans:
            ans = dp[0]
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,m = LI()
    v = [[] for i in range(n)]
    v_ = [[] for i in range(n)]
    for i in range(m):
        a,b = LI()
        a -= 1
        b -= 1
        v[a].append(b)
        v_[b].append(a)
    dp_ = [0]*n
    for y in range(1,n)[::-1]:
        v_[y].sort()
        d = dp_[y]
        for x in v_[y]:
            dp_[x] += (d+1)/len(v[x])
    ans = dp_[0]
    lx = []
    for a in range(n-1):
        lx.append(len(v[a])-1)
        if len(v[a]) == 1:
            lx[-1] += 1
            continue
        m = max([dp_[b] for b in v[a]])
        for b in v[a]:
            if dp_[b] == m:
                break
        for i in range(a+1):
            dp_[i] = 0
        for y in range(1,n)[::-1]:
            d = dp_[y]
            for x in v_[y]:
                if x > a:
                    break
                if (x,y) == (a,b):
                    continue
                dp_[x] += (d+1)/lx[x]
        if 0 < dp_[0] < ans:
            ans = dp_[0]
        lx[-1] += 1
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()