A, B = (int(x) for x in input().split()) if B > A: A, B = B, A if pow(A,B/A)==B: print('Yes') else: print('No')