A10223. The Sum of the k-th Powers
编程题
普及/提高-
知识点
题目描述
There are well-known formulas: , , . Also mathematicians found similar formulas for higher degrees.
Find the value of the sum  modulo $10^{9}+7$ (so you should find the remainder after dividing the answer by the value $10^{9}+7$ ).
Find the value of the sum  modulo $10^{9}+7$ (so you should find the remainder after dividing the answer by the value $10^{9}+7$ ).
输入格式
The only line contains two integers $n,k$ ( $1<=n<=10^{9},0<=k<=10^{6}$ ).
输出格式
Print the only integer $a$ — the remainder after dividing the value of the sum by the value $10^{9}+7$ .
输入输出样例
输入 #1
4 1
输出 #1
10
输入 #2
4 2
输出 #2
30
输入 #3
4 3
输出 #3
100
输入 #4
4 0
输出 #4
4