module SS = Set.Make(String)

let () =
  let n = read_int () in
  let doit (op, x) s =
    if op = "insert" then SS.add x s
    else if op = "find" then (print_endline (if SS.mem x s then "yes" else "no"); s)
    else exit 1
  in
  let rec read i s =
    if i >= n then ()
    else begin
      match Str.split (Str.regexp_string " ") (read_line ()) with
      | [] | [_] -> exit 1
      | op :: x :: _ -> read (i + 1) (doit (op, x) s)
    end
  in
  read 0 (SS.empty)