Binomial Coefficient 3
Time limit1sMemory limit256 MB
Compute the binomial coefficient C(N, K) modulo 1,000,000,007 for N up to 4,000,000.
- Level
Medium4 of 10
- Topics
- Combinatorics, Number theory
- Solved
- No attempts yet
Problem
You are given a natural number and an integer . Write a program that computes the remainder of the binomial coefficient divided by 1,000,000,007.
Input
The first line contains and , separated by a single space. (, )
Output
Print the remainder of divided by 1,000,000,007 on the first line.