module List = struct
  include List
  let rec init_tailrec_aux acc i n f =
    if i >= n then acc
    else init_tailrec_aux (f i :: acc) (i+1) n f

  let rec init_aux i n f =
    if i >= n then []
    else
      let r = f i in
      r :: init_aux (i+1) n f

  let init len f =
    if len < 0 then invalid_arg "List.init" else
    if len > 10_000 then rev (init_tailrec_aux [] 0 len f)
    else init_aux 0 len f

  let rec find_opt p = function
    | [] -> None
    | x :: l -> if p x then Some x else find_opt p l
end

let () =
  let a, b = Scanf.scanf "%s %s " (fun a b -> a, b) in
  let ab = int_of_string (a^b) in
  let pows = List.init 10000 (fun i -> (10000-i) * (10000-i)) in
  Printf.printf "%s\n" (
    match (List.find_opt (fun x -> x = ab) pows) with
      Some x -> "Yes"
    | None -> "No"
  )
