A,B=map(int,input().split()) import math #print( math.gcd(A,B)) if 1 in {A,B}: print('YES') elif max({A, B}) >= math.gcd(A,B) != 1: print('YES') else: print('NO')