1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | def pow(a, b): if b == 0: return 1 mid = pow(a, b // 2) if b % 2 == 0: return mid * mid % p else: return a * mid * mid % p n, k = map(int, input().split()) p = 1000000007 fact = [1 for _ in range(n + 1)] for i in range(2, n + 1): fact[i] = fact[i – 1] * i % p t_1 = fact[n] % p t_2 = pow(fact[k] * fact[n – k] % p, p – 2) % p print(t_1 * t_2 % p) | cs |