let hash = Hashtbl.create 1000000;;

let _ =
  let n = read_int ()
  in
  let rec read = function
      0 -> ()
    | i ->
       let (op, key) = Scanf.scanf "%s %s\n" (fun x y -> (x,y)) in
       if op = "insert" then
         Hashtbl.add hash key key
       else if op = "find" then
         if Hashtbl.mem hash key then print_endline "yes"
         else print_endline "no"
       ;read (i-1)
  in read n;;