# coding: utf-8 # Your code here! n,z=map(int,input().split()) opt=[] for num in range(1,z): opt.append(num**n) ans="No" for item in opt: if z**n-item in opt: ans="Yes" print(ans)