BETA
Successful submissions of School Problems are not counted in user ratings.

Submissions : 1057 Accuracy :

36.05

Krishnamurthy number
       

A Krishnamurthy number is a number whose sum of the factorial of digits is equal to the number itself. Given a number N as input. Write a program to check whether this number is krishnamurthy number or not.

Input:
First line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a single integer N.

Output:
For each test case print "YES" without quotes if N is a Krishnamurthy Number otherwise print "NO".

Constraints:
1<=T<=100
1<=N<=105

Example:
Input:

2
145
235
Output:
YES
NO

**For More Examples Use Expected Output**


Contributor: Harsh Agarwal

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.