let () =
  let n = read_int () in
  let tbl = Hashtbl.create ~random:true n in
  let rec read i =
    if i <= 0 then ()
    else begin
      match Scanf.scanf "%s %s\n" (fun x y -> (x, y)) with
      | ("insert", x) -> (Hashtbl.add tbl x true; read (i - 1))
      | ("find", x) -> (print_endline (if Hashtbl.mem tbl x then "yes" else "no"); read (i - 1))
      | _ -> exit 1
    end
  in
  read n