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