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 :
- A structure with only one hexagon is valid.
- 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.
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.
For each test case, output a single line containing an uppercase Ã¢â‚¬Å“YÃ¢â‚¬Â if N is a Hex-Number, or an uppercase Ã¢â‚¬Å“NÃ¢â‚¬Â otherwise.
Problem Setter : Neesha Sinha