NIO is playing a D\&D-like game.
In this game, the map can be concerned as a connected graph with

vertices and

edges. The vertices are numbered from

to

and vertex

is the destination of his journey. Initially, all edges can be passed in both directions. At the beginning of the game,

edges will be randomly selected to become directed edges.
All directed edges point to the destination which means he can only approach the destination along the directed edge
. In this way, no matter which edge is selected, he can still reach the destination.
But unfortunately, NIO is a road nut. He started at vertex

. At each step, he will randomly select an available edge connected with the current vertex and move to the adjacent vertex.
NIO wanted to know how many steps he expected to take to reach the destination.
Since the answer is too large, NIO only wants to know it modulo

.