All Submissions


Problem Specification:

There exists a structure consisting only of hexagons. This structure is made such that each hexagon in the structure may have 6 neighbors ( one for each side ). If a hexagon has six neighbors then that hexagon is said to be internal, any hexagon with less than six neighbors is external.

Only a certain subset of these structures are said to be valid. A valid structure can be recursively as follows :
  1. A structure with only one hexagon is valid.
  2. Given a valid structure B, if we add a certain minimum number of hexagons to make every external hexagon of B an internal hexagon, then the result is a valid structure.

The number of hexagons in a valid structure is called a Hex-Number, given a number you have to determine whether it is a Hex-Number or not.

Input Specification

Each test case is described using a single line. The line contains an integer N (1 <= N <= 10^9 ). The end of input is indicated with a line containing a single -1.

Output Specification
For each test case, output a single line containing an uppercase “Y” if N is a Hex-Number, or an uppercase “N” otherwise.

Sample Input


43
1
7
19
15
-1


Sample Output


N
Y
Y
Y
N


Problem Setter : Neesha Sinha

Languages: C,C++,Java

Time Limit: 1 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