import qualified Data.Map.Strict as Map

--only key map as dictionary
type Dictionary = Map.Map String ()

insert::Dictionary -> String -> Dictionary
insert dic x = Map.insert x () dic

find::Dictionary -> String -> Bool
find dic x = Map.member x dic


do_n::Dictionary -> Int -> IO()
do_n d 0 = return()
do_n d n = do
  order<-getLine
  let ord:v:[] = words order
  if ord == "insert" then do
    do_n (insert d v) (n-1)
                     else do
    putStr (if (find d v) then "yes" else "no")
    putStr "\n"
    do_n d (n-1)

main::IO()
main = do
  nc<-getLine
  let n = read nc::Int
  do_n Map.empty n