Leap Year Check
1.0s 256MIt takes approximately \(365.242199\) days for the Earth to orbit the Sun, so if we approximate a year as \(365\) days, an extra \(0.968796\) days accumulate every four years. Therefore, adding one extra day every four years was proposed; this is called a leap year.
Currently, the leap year rules are as follows (Gregorian calendar):
- If the year is not a multiple of \(4\), it is a common year.
- If the year is a multiple of \(4\) but not a multiple of \(100\), it is a leap year.
- If the year is a multiple of \(100\) but not a multiple of \(400\), it is a common year.
- If the year is a multiple of \(400\), it is a leap year.
Now, given a year, determine whether it is a leap year.
Input
The input consists of a single positive integer \(N\), representing the year (AD \(N\)). (\(1 \leq N \leq 3000\))
Output
If the year is a leap year, output YES; otherwise, output NO.
Sample Input 1
2020
Sample Output 1
YES
Sample Input 2
2022
Sample Output 2
NO
Log in to write and submit code. Creating an account is free.