import qualified Data.Map 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

nget::Int->IO[(String,String)]
nget 0 = return []
nget n = do
  order<-getLine
  let ord:i:[]=(words order)
  rest<-nget (n-1)
  return ((ord,i):rest)

do_order::Dictionary -> [(String,String)] -> IO()
do_order d     []    = return ()
do_order d (("insert",v):os)= do_order (insert d v) os
do_order d (("find"  ,v):os)= do
  putStr (if (find d v) then "yes" else "no")
  putStr "\n"
  do_order d os


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