I need to calculate nCr mod M, where M is a product of prime numbers and n and r can be very large (~10^8). I tried to write n!, (n-r)! and r
n!
(n-r)!
r