N,Z=map(int,input().split()) if N==1: ans="Yes" elif N==2: st=set() for X in range(1,Z): if X**N>Z**N: break st.add(X**N) ans="No" for x in st: if Z-x in st: ans="Yes" else: ans="No" print(ans)