Read a file and print N mod M