Leap years P61634


Statement
 

pdf   zip

html

Write a program that tells if a year is or is not a leap year.

A leap year has 366 days. After the Gregorian reform, the leap years are those multiple of four that do not end with two zeros, and also the years ending with two zeros such that, after removing these two zeros, are divisible by four. Thus, 1800 and 1900, although being multiples of four, were not leap years; by contrast, 2000 was a leap year.

Input

Input consists of a natural number between 1800 and 9999.

Output

If the year is a leap year, print “YES”; otherwise print “NO”.

Public test cases
  • Input

    1999
    

    Output

    NO
    
  • Input

    1968
    

    Output

    YES
    
  • Input

    2000
    

    Output

    YES
    
  • Input

    1800
    

    Output

    NO
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    Ada C C++ Java Lua Perl PHP Python Ruby Rust