http://noi.openjudge.cn/ch0104/17/
/*
1.4编程基础之逻辑表达式与条件分支 17 判断闰年
http://noi.openjudge.cn/ch0104/17/
https://blog.csdn.net/yigezzchengxuyuan/article/details/86651658
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin>>a;
if(a%4==0)
{
if(a%100==0)
{
if(a%400!=0)
{
cout<<"N";
}
else
{
cout<<"Y";
}
}
else
{
cout<<"Y";
}
}
else
{
cout<<"N";
}
return 0;
}