#000716

O-Divisibility

Your task is to check divisibility for two integers.


Divisibility rules You have on http://en.wikipedia.org/wiki/Divisibility_rule


InputIn the first line of input is integer N. (1 <= N <= 16).
In next 10 lines, there are one integer per line, not longer then 1000 digits.

OutputFor every of input integers given in lines from 2 to 11 write whether is this integer divisible by N. Output „YES“ or „NO“


Input:
2
3
45
56
67
98765
223452345
5444
0
1000000000
3216548

Output:
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES



Input:
7
21
22
77777777
414141
11
5
1000000000
1001
654
123321132

Output:
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO


In 20% tests all numbers will be < 10^18.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.