No.3406 Joya no Kane
Problem Statement
Taro is going to strike the Joya no Kane (New Year's Eve temple bell).
Each time Taro strikes the bell, his worldly desires decrease by 1, and he keeps striking until he has no worldly desires left.
Taro has $N$ worldly desires, and one strike of the bell takes $A$ seconds.
The current date and time is December 31, 2025, $H$ hours $M$ minutes $S$ seconds. If Taro starts striking the bell now, answer whether he can cross into the new year$\color{red}^{*1}$ while striking the bell or at the moment he finishes striking.
$\color{red}^{*1}$ What crossing into the new year means (click to open)
It means the year changes, but since the date here is December 31, 2025, it refers to the date changing.
Constraints
- $1 \le N \le 500$
- $1 \le A \le 300$
- $0 \le H \le 23$
- $0 \le M \le 59$
- $0 \le S \le 59$
- All inputs are integers.
Input
The input is given from standard input in the following format.
$N$ $A$ $H$ $M$ $S$
Output
Print Yes if Taro crosses into the new year while striking the bell or at the moment he finishes striking, and No if he does not, followed by a newline.
Sample
Sample 1
Input
108 100 23 0 0
Output
Yes
Taro finishes striking the bell in 3 hours, so he can cross into the new year while striking the bell.
Sample 2
Input
150 300 0 0 0
Output
No
Sample 3
Input
150 60 21 30 0
Output
Yes
It may also be that 0:00 arrives exactly when he finishes striking the bell.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。