more N Mod M

Scala