SNGNM1 - Number Magic I

no tags 

Consider a positive integer 2340, 2340 is divisible by 2, 3 and 4, divisibility by 0 is not defined so considering this we can conclude that 2340 is divisible by all its digits individually. Lets say this type of number is magic number. 0 is not considered as magic number.

Input

First line of input contains t, total number of test cases. Next t (t < 11) lines contain one positive integer n (n < 10001) each.

Output

Output is "yes" if number is magic number, otherwise output is "no".

Example

Input:
5
2340
36
800
435
48 Output: yes
yes
yes
no
yes

hide comments
manisha malik: 2015-06-15 17:31:24

take care of "yes", it costed me 4 wa's .... :(

Karthick: 2014-07-16 17:37:49

<snip>
i'm getting wrong answer.
Help me out!!!

Last edit: 2023-03-19 17:01:11

Added by:AvmnuSng
Date:2013-08-28
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Abhimanyu Singh
My Problems