DiviDuelo

시간 제한1초메모리 제한1024 MB

요약
N의 약수를 두 사람이 번갈아 하나씩 가져가며, 선공이 가져간 수들의 최대공약수가 1이 아니면 선공이 이긴다. 최선의 플레이에서 승자를 판정한다.
난이도

보통10점 중 7점

유형
게임 이론, 정수론, 수학
정답자
아직 제출이 없습니다

문제

The Intense Challenges Players Club (ICPC) is hosting a DiviDuelo tournament.

DiviDuelo is a new two-player, turn-based game. In DiviDuelo, a number NN is selected and the list of its divisors is written. For example, if N=10N = 10 is selected, the list of numbers 11, 22, 55, 1010 is written. Players alternate turns picking one still unpicked divisor from the list each turn, until all divisors have been picked.

The winner is determined by the greatest common divisor (GCD) of the numbers picked by the starting player. If the GCD is not equal to 11, the starting player wins. Otherwise, if the GCD is equal to 11, the other player wins.

The ICPC needs your help to prepare some statistics about the games played in the tournament. Given the value of NN, determine if the starting player can win the game assuming both players play optimally.

입력

The input consists of a single line that contains an integer NN (1≤N≤10121 ≤ N ≤ 10^{12}) indicating the number selected for the game.

출력

Output a single line with the uppercase letter “Y” if the starting player can win the game and the uppercase letter “N” otherwise, assuming both players play optimally.

예제3

  1. 예제 1

    입력
    10
    
    예상 출력
    Y
    
  2. 예제 2

    입력
    9
    
    예상 출력
    N
    
  3. 예제 3

    입력
    1
    
    예상 출력
    N