All Submissions


STATEMENT:
The GRAND coding challenge of 2k13 CODEZILLA is here!
This time the ACM members decided that the participants will be allotted ID numbers formed by concatenation of numbers 1, 14 and 144 only.
For Example:141144,11114144 are valid IDs but 5,1514,411 are not.

The list was prepared accordingly but it got mixed up with another list.
As we are short of time we turn to you, the BUDDING CODERS, for help.
All you need to do is given a number, if it is a valid ID number print "YES", else print "NO".

INPUT:
The first line will contain a number T, the number of test cases.
Following T lines will each contain a number N. You have to check if this is a valid ID according to the rules given above.

OUTPUT:
For each test case,on a separate line,print "YES" if valid and "NO" if not .

SAMPLE INPUT:
5
13
14
144
14141
5


SAMPLE OUTPUT:
NO
YES
YES
YES
NO


CONSTRAINTS:

T<=100
N<=10^9

Problem Setter : Shradha Chhaparia
Problem Tester : Shikhar Sharad


Languages: Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Ruby,Text

Time Limit: 2 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0