Problem list
Log in
#icpc00371 · ICPC BAPC 2025

Knowing the Clock

Bronze I 1.0 s 2048 MB

It is the 25th of November, 1625. You have put a lot of time into making a mechanical watch, but you are unsure if the hands are placed correctly. Even a watch that is not running is correct twice a day, but if the hands of the watch do not correspond to a real time, it is never correct at all. Without wasting any more time, you measure the angles of the hands and check whether they correspond to a real time.

For example, consider the first sample input, visualized in Figure : if the minute hand points to a quarter past (90 degrees from 12 o'clock), then the hour hand cannot point exactly to 2 o'clock (60 degrees from 12 o'clock).

You know that both hands of the watch are moving continuously.

Input

The input consists of:

  • One line with two integers $h$ and $m$ ($0 \leq h, m \leq 359$), the exact clockwise angle that the hour hand is from 12 o'clock and the exact clockwise angle that the minute hand is from 12 o'clock. Both angles are given in degrees.

Output

If the angles of the hands correspond to a real time, output "yes". Otherwise, output "no".

Example 1

Input
60 90
Output
no

Example 2

Input
30 0
Output
yes

Example 3

Input
30 1
Output
no

Example 4

Input
32 24
Output
yes
Source
ICPC BAPC 2025
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code