LearnPy Hub
← Arena
IntermediateRating 1100

Is the Date Real?

Print YES if day d, month m, year y is a real calendar date (Gregorian calendar, with leap years).

Input

Three integers d m y (1 ≤ y ≤ 9999).

Output

YES or NO.

Sample 1

Input
29 2 2024
Output
YES

Sample 2

Input
29 2 2023
Output
NO
solution.py
Output appears here
Is the Date Real? · Python Arena problem · LearnPy Hub