#CCBCMCHIN0000034. Giờ hợp lệ (Valid Time)
Giờ hợp lệ (Valid Time)
Valid Time
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
On a 24-hour clock, the hour ranges from through and the minute from through . Given integers , determine whether they form a valid time.
Input
A line contains two integers and , representing the hour and minute.
Output
Print YES for a valid clock time; otherwise print NO.
Subtasks
Subtask 1 (20 points): Both h and m are integers in [-24,24]. Subtask 2 (30 points): Both h and m are integers in [-100,100]. Subtask 3 (50 points): Both h and m are integers in [-1000,1000].
Examples
Example 1
Input
23 59
Output
YES
Explanation
Hour 23 is within 0–23 and minute 59 is within 0–59.
Example 2
Input
24 0
Output
NO
Explanation
The hour 24 is outside the valid range.