#include<stdio.h>
#include<math.h>
int main()
{
	double a, b;
	scanf("%lf%lf", &a, &b);
	if (b > 0)
	{
		for (; b > 1; b -= 1);
	}
	else
	{
		for (; b < -1; b += 1);
	}
	double c = pow(a, b), eps = 1e-12;
	if (c - eps <= round(c) && round(c) <= c + eps)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}