n,z=map(int,input().split()) k=1 if n==1: k=z==1 else: a=[x**n for x in range(1,z+1)] for x in a: if z**n-x in a: k=0 print('YNeos'[k::2])