using static System.Math; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var z = int.Parse(line[1]); if (n == 3) Console.WriteLine("No"); else getAns(n, z); } static void getAns(int n, int z) { var zn = (int)Pow(z, n); for (int i = 1; i <= z; i++) for (int j = i; j <= z; j++) { if ((int)Pow(i, n) + (int)Pow(j, n) == zn) { Console.WriteLine("Yes"); return; } } Console.WriteLine("No"); } }