3131: 0G 2-2 TS

时间限制:1000 ms 内存限制:128 MB
上传者:
提交:4 通过:2

题目描述

There are two teams of heros, the number of team 0G and team Sprite are equal. 

One day, Sprite decide to start a war to 0G .So team Sprite randomly attack one hero of  0G. Randomly means will choose a hero with equal probability.

After bing attacked,0G's injured hero who just being attack can choose one of Sprite's hero. The chosen hero must in attacker's range. Then, Sprite's injured hero  who just being attacked can choose one and attack also,the chosen hero must in attacker's range and is not injured(heroes never attack an injured hero).They do this turn by turn until one of hero who just being attacked can't find an opponent hero to attack.

After the war stop, if 0G's number of hero without injured no more than Sprite,0G will win.You need to find out the probability of 0G's win.You need to modulo the probability by $1000000009$.


输入格式

The first row contains two numbers, $n$($2 \leq n \leq 5*10^4$) and $m$($2 \leq m \leq 5*10^4$), indicating the number of heros each team has and the number of relationships it can attack each other.

The next $m$ lines, each containing two numbers, $x$ and $y$($1 \leq x, y \leq n$), indicate that 0G's x'th hero and Sprite's y'th hero are in each other's attack range.

输出格式

Output the probability of 0G's winning, mod $1000000009$.

输入样例 复制

2 3
1 1
1 2
2 2

输出样例 复制

1