Lost in the Woods

Given an undirected graph, find the expected number of random-walk steps from node 0 until node N-1 is reached.

Medium6GraphProbabilityMathImplementationNo attempts yetTime limit5sMemory limit512 MB

Problem

Your friend is lost in the woods. He called and asked you to come get him, but you are very busy and would rather stay home. You look up a map of the woods. The woods consist of a small number of clearings with paths connecting them. You hope the woods are small and simple enough that your friend gets out easily even if he just runs around at random.

From your friend's description you can tell which clearing he is in right now. Every time he reaches a clearing he picks one of the paths leading out of it uniformly at random and runs down it. That includes the path he just came from. Moving from one clearing to the next takes him exactly one minute. Compute the expected number of minutes until he gets out of the woods.

Input

The first line contains two integers NN and MM. NN is the number of clearings in the woods (2N202 \le N \le 20) and MM is the number of paths between clearings. The clearings are numbered 00 through N1N-1. Clearing 00 is where your friend is right now and clearing N1N-1 is the exit of the woods.

Each of the next MM lines contains two integers KK and LL, meaning there is a path between clearing KK and clearing LL (0K,LN10 \le K, L \le N-1, KLK \ne L).

Your friend can reach the exit by following paths. At most one path runs between any two clearings, and paths do not cross. Some clearings may be unreachable from clearing 00.

Output

Print one line with the expected number of minutes until your friend gets out of the woods. Round the value at the seventh decimal digit, rounding a half up, and print exactly six digits after the decimal point.