P = gets.to_i v = 1 while v * v < P r = P - v * v vr = Math.sqrt(r) if vr == vr.to_i puts 'Yes' exit end v += 1 end puts 'No'