module SS = Set.Make(String)

let _ =
  let n = read_int () in
  let s = SS.empty in
  let rec read i acc =
    if i >= n then acc
    else begin
      match Str.split (Str.regexp_string " ") (read_line ()) with
      | [] | [_] -> exit 1
      | op :: x :: _ -> read (i + 1) ((op, x) :: acc)
    end
  in
  let cmds = read 0 [] 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
  List.fold_right doit cmds s