Leap Year Check

1.0s 256M

It 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

Problem page help

Keyboard shortcuts

Main features

  • Sample tests — Runs the sample cases bundled with the problem and auto-compares against the expected output.
  • Custom test — Run your code with your own stdin. Optionally tick the "Compare with expected (diff)" box to verify against expected output line-by-line.
  • Template — Paste the default code template you set on your profile page.
  • Collab — Edit this problem together with classmates in real time.
  • Auto-draft — Editor contents auto-save to your browser every 1.5 seconds (per account / problem / language).
  • Submit — Send your code to the judge for grading; returns AC / WA / TLE etc.

Limits

  • Source code: at most 65,536 characters
  • Custom test stdin and expected output: at most 1 MB each (≈1 million characters)
  • Custom test: about 1 request per 3 s per user (sample test: 1 per 1 s)
  • Custom test has a 15 second wall-clock cap; sample tests use the problem time limit, the same as the official judge
  • Interactive problems do not offer custom test (cannot simulate interaction with the judge).
  • Submitting has no rate limit, but rapid repeated submissions on the same problem are treated as score farming.