let () =
  let n = read_int () in
  let (tbl : (string, unit) Hashtbl.t) = Hashtbl.create n in
  for _ = 0 to n - 1 do
    match Scanf.scanf "%s %s\n" (fun inst str -> (inst, str)) with
    | ("insert", s) -> Hashtbl.add tbl s ()
    | ("find", s) -> print_endline (if Hashtbl.mem tbl s then "yes" else "no")
    | _ -> assert false
  done