{-# OPTIONS_GHC -O2 #-}

import qualified  Data.Map.Strict as Map

main = do
  n   <- readLn
  dictionary n Map.empty

dictionary n maps = do

-- Stop condition
  if n == 0 then return ()
  else do
    s' <- getLine
    let [fOI,str] = words s'

--Separate cases with find and insert
    if fOI == "find"
       then do
         putStrLn (findDic str maps)
         dictionary (n-1) maps
       else
         dictionary (n-1) (insertDic str maps)

--Because list is slow, use Data.Map
insertDic str maps = Map.insert str "" maps

--Corresponds when reference is not possible by using the lookup function
findDic   str maps
  | Map.lookup str maps == Nothing = "no"
  | otherwise                      = "yes"