The first line contains a positive integer .The second line contains positive integers
Output an integer on a line, which is the answer, modulo .
3 2 5 4
172