Hour Hand and Minute Hand

No attempts yetTime limit1sMemory limit128 MB

Problem

The clock hanging in Sanggeun's room is a perfect circle, with an hour hand and a minute hand rotating around its center. The hour hand shows the hour and the minute hand shows the minutes. Along the rim there are $60$ tick marks placed at equal intervals, and the gap between any two neighboring ticks is the same.

The minute hand advances to the next tick once every minute, and the hour hand advances to the next tick once every $12$ minutes. Thus after one hour ($60$ minutes) the hour hand moves five ticks. Whenever the hour or the minute changes, both hands jump straight to the next tick. In other words, the hour hand and the minute hand always point exactly at some tick and never point between two ticks.

Midnight is the moment when both hands point at the topmost tick at the same time, representing $0$ hours and $0$ minutes. Starting from that state, after $12$ hours ($720$ minutes) the two hands return to the same position, and this motion repeats forever.

There are moments when only the minute hand moves while the hour hand stays put, but whenever the hour hand moves, the minute hand always moves as well.

Sanggeun loves geometry, so every time he looks at the clock he computes the angle between the hour hand and the minute hand and writes it down. After several years his paper was covered with a huge number of angles, and he noticed that some angles appear again and again while others never appear at all. For example, at $3$ o'clock and at $9$ o'clock the angle between the two hands is $90$ degrees, but there is no time at which they form $65$ degrees.

Given an integer $A$ with $0 \le A \le 180$, write a program that determines whether there exists a time at which the angle between the hour hand and the minute hand of Sanggeun's clock is exactly $A$ degrees.

Input

The input consists of several test cases. Each test case is a single line containing an integer $A$ ($0 \le A \le 180$). The input continues until the end of file.

Output

For each test case, print Y on its own line if there is a time at which the angle between the hour and minute hands is $A$ degrees, and N otherwise.