favorite We need a little bit of your help to keep things running, click on this banner to learn more

Circle of choirs

Circle of choirs

A section of choral singing operates in school. The start of the section always happens in the same way: by the signal of the header of the section all n participants stand in a circle and each m-th person sings a gamut for singing.

The leader of the section noticed that all the members are not always able to stretch their vocal cords. Given n and m, help him to determine whether or not all the choir participants will take part in the warm-up again.


Consists of several cases. Each case contains two positive integers n and m (1n, m103).


If everyone has a chance to sing, print "YES", otherwise "NO".

Time limit 1 second
Memory limit 128 MiB
Input example #1
4 1
6 3
Output example #1
ТЕХнические проблемы