Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Jigsaw Puzzle

By HillolTalukdar · Limits 1s, 256 MB

The class teacher of class 7 gave all the students an assignment. The assignment was to solve a “Jigsaw Puzzle”. Shantunu is a student of that class. As Shantunu is good at solving puzzle, he easily solved that puzzle. The next day, when he woke up, he was very surprised. Because, his little brother Turzo totally destroyed that puzzle. Now he has to solve this again.

Shantunu’s school starts at 11:45 am. He needs 30 minutes (including getting ready) to reach his school.

Now you have to figure it out that, can he solve the puzzle within time?

Input

There will be two lines in the input.

First line of input contains a time in the 24-hour clock format HH:MM (0 ≤ HH ≤ 12, 0 ≤ MM ≤ 59) when Shantunu will start to solve. The next line will be followed by an integer M (5 ≤ M ≤ 719) the minutes required to solve the puzzle.

Output

Print “YES” if Shantunu can solve the puzzle within time or else “NO” (w/o quotes).

Samples

InputOutput
7:50
90
YES
InputOutput
10:00
120
NO

Discussion

Statistics


95% Solution Ratio

shojib_muEarliest, Jul '19

shojib_muFastest, 0.0s

HillolTalukdarLightest, 0 B

bokaifShortest, 77B

Submit

Login to submit

Toph uses cookies. By continuing you agree to our Cookie Policy.