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. (1 ≤ N, M ≤ 103).
Output
If everyone has a chance to sing, print "YES", else "NO".
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 28% 367/508
Classes: Comforting task, Simple mathematics, Beginners, GCD, LCM
Example
Example input4 1 6 3 |
Example outputYES NO |
| Problems | Euclid Problem → |
