Time

18:08:10
22 May 2012
Version for print

Circle of choirs

   In a school operates a circle of choral singing. Start mug always happen consistently: the signal head mug all N participants are in a circle and every M-th for raspevki singing styles.

   
Head of the circle noticed that stretch the vocal chords is not always possible to all participants of the circle. For given N and M help him to define, or once again in the warm-up will be attended by all members of the choir.


Specifications

   Input

   The input file consists several cases. Each case contains two positive integers N and M. (1N, M103).

   Output

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


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 10
Complexity: 28% 367/508
Classes: Comforting task, Simple mathematics, Beginners, GCD, LCM

Example

Example input

4 1
6 3

Example output

YES
NO


Problems Euclid Problem →