Solution of #78.
Apply mod not to use BigInt.