from fractions import Fraction a, b = map(Fraction, input().split()) print("Yes" if (a**b).is_integer() else "No")