N,Z=map(int,input().split()) if N==1: if Z>=2: ans="Yes" else: ans="No" 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**N-x in st: ans="Yes" else: ans="No" print(ans)