But due to the unstable magic field, some connections may disappear in some days. Luckily, thanks to Twilight's research, we know that the probability for the -th connection to exist on the
-th day
is
, where
is a given constant. Twilight Sparkle wants to know the expectation of total defense power she can gain in
days. Can you help her and protect Ponyville?
The first line containsintegers
![]()
.
The followinglines are the
connections. The
-th line contains
integers
, indicating that the
-th connection is between
and
,
(
and
).
It's guaranteed that all the data are picked randomly.
One integer indicating the expectation of the total defense power Twilight Sparkle can get. You should output the answer modulo
. Formally, let
. It can be shown that the answer can be expressed as an irreducible fraction
, where
and
are integers and
. Output the integer equal to
. In other words, output such an integer
that
and
.