시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB38343288.889%

문제

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 K.1: 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.

Figure K.1: Illustrations of the sample inputs. The first and third sample inputs do not correspond to a real time. The second and fourth sample inputs do correspond to a real time.

입력

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.

출력

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

예제 입력 1

60 90

예제 출력 1

no

예제 입력 2

30 0

예제 출력 2

yes

예제 입력 3

30 1

예제 출력 3

no

예제 입력 4

32 24

예제 출력 4

yes

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2025 K번

  • 문제를 만든 사람: Wietze Koops