#Lutece3033. 简单算数

简单算数

Migrated from Lutece 3033 简单算数

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

maco喜欢计算和式

i=1nik\sum_{i=1}^n i^k

答案对 109+710^9+7 取模

这是什么签到题?快速幂?

哦,原来 nn 的范围是 10910^9 ,而且时限300ms,那没事了。

Input

输入两个正整数 nn , kk

Output

输出答案

Samples

7 2
140
7 10
353815700

Constraints

1n1091≤n≤10^9 1k1061≤k≤10^6

Note

注:时限300ms是因为lutece测评机速度极快,绝对没有卡常的意思。

Resources

2023 UESTC ICPC Training for Math