#d11301. 序列中ab的个数

序列中ab的个数

Expected Number of "ab" Subsequences

Problem Description

You are given three integers k,pa,pbk, p_a, p_b. Initially there is an empty sequence. Each second, one of the following happens:

  • with probability papa+pb\dfrac{p_a}{p_a + p_b}, append the character a to the end;
  • with probability pbpa+pb\dfrac{p_b}{p_a + p_b}, append the character b to the end.

The process stops as soon as the sequence contains at least kk occurrences of the subsequence ab. Find the expected total number of ab subsequences at the end, and output the answer modulo 109+710^9+7 as an integer.

Input Format

One line containing three integers k,pa,pbk, p_a, p_b.

Output Format

One integer: the answer.

Sample Input 1

3 1 4

Sample Output 1

370000006

Sample Input 2

1 1 1

Sample Output 2

2

Constraints

For all data, 1≤k≤10001 \le k \le 1000 and 1≤pa,pb≤1061 \le p_a, p_b \le 10^6.