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