Function to return the value of n ! / ( ( n - k ) ! * k ! )
function nck ( N , K ) { var factN = factorial ( N ) ; var inv = Inversefactorial ( K ) ; var invFact = Inversefactorial ( N - K ) ; return ( ( ( factN * inv ) % Mod ) * invFact ) % Mod ; }