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