题目描述
There are well-known formulas: $$\sum_{i=1}^{n} i = 1 + 2 + \ldots + n = \frac{n(n+1)}{2}$$, $$\sum_{i=1}^{n} i^2 = 1^2 + 2^2 + \ldots + n^2 = \frac{n(2n+1)(n+1)}{6}$$, $$\sum_{i=1}^{n} i^3 = 1^3 + 2^3 + \ldots + n^3 = \left(\frac{n(n+1)}{2}\right)^2$$. Also mathematicians found similar formulas for higher degrees.
Find the value of the sum $$\sum_{i=1}^{n} i^k = 1^k + 2^k + \ldots + n^k$$ modulo 109 + 7 (so you should find the remainder after dividing the answer by the value 109 + 7).
Input
The only line contains two integers n, k (1 ≤ n ≤ 109, 0 ≤ k ≤ 106).
Output
Print the only integer a — the remainder after dividing the value of the sum by the value 109 + 7.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分
样例输入
4 1
样例输出
10