Time limit
2s
Memory limit
128 MB
Given positive integers N and K, compute the following value modulo 1,000,000,007.
1^K + 2^K + 3^K + ... + N^K
The first line contains two positive integers, N and K. N is at most 10^9, and K is at most 50.
Print the remainder of 1^K + 2^K + 3^K + ... + N^K divided by 1,000,000,007.