{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as B
import Data.Bool
import Data.Char
import Data.Maybe

main :: IO ()
main = B.interact $ squared . conn

conn :: B.ByteString -> Int
conn = fst . fromJust . B.readInt . B.filter isDigit

squared :: Int -> B.ByteString
squared n = bool "No" "Yes" $ go n 0 n

go :: Int -> Int -> Int -> Bool
go n l u
  | m ^ 2 == n || (m + 1) ^ 2 == n = True
  | u - l <= 1 = False
  | m ^ 2 < n = go m u
  | m ^ 2 > n = go l m
  where m = (l + u) `div` 2
  
