{"raw_statement":[{"iden":"problem statement","content":"You are given integers $N$ and $A$.\nYou will perform the following operations:\n\n*   Generate $N$ real numbers uniformly at random between $0$ and $1$, inclusive. All generations are independent, and the random numbers are uniformly distributed.\n*   Call the generated $N$ real numbers $x_1, x_2, \\cdots, x_N$ in ascending order. That is, $0 \\leq x_1 \\leq x_2 \\leq \\cdots \\leq x_N \\leq 1$.\n*   Your score is given by the following formula:\n\n$\\displaystyle \\prod_{i=1}^{N} \\left(1+\\sum_{j=i+1}^N x_j^A \\right)$\n\nCalculate the expected value, modulo $10^9+7$, of the score.\nDefinition of expected value modulo $10^9+7$It can be proved that the sought expected value is always rational. Furthermore, under the constraints of this problem, it can be proved that if the expected value is expressed as an irreducible fraction $\\frac{P}{Q}$, then $Q \\neq 0 \\pmod{10^9+7}$. Therefore, there exists a unique integer $R$ such that $R \\times Q \\equiv P \\pmod{10^9+7}, 0 \\leq R < 10^9+7$. Report this $R$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^4$\n*   $1 \\leq A \\leq 5 \\times 10^4$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $A$"},{"iden":"sample input 1","content":"2 1"},{"iden":"sample output 1","content":"666666673\n\nThe expected value of the score is $5/3$."},{"iden":"sample input 2","content":"1 1"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"2 2"},{"iden":"sample output 3","content":"500000005"},{"iden":"sample input 4","content":"3 2"},{"iden":"sample output 4","content":"142857147"},{"iden":"sample input 5","content":"5 3"},{"iden":"sample output 5","content":"758371066"},{"iden":"sample input 6","content":"10000 12345"},{"iden":"sample output 6","content":"32201773"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}