let () =
  let n = read_int () in
  let tbl = Hashtbl.create 1000000 in
  let rec loop = function
      0 -> ()
    | i ->
      begin match Scanf.scanf "%s %s\n" (fun a b -> a,b) with
          "insert",word -> Hashtbl.add tbl word 0
        | _,word ->
          print_endline
            (if Hashtbl.mem tbl word then "yes" else "no")
      end;
      loop (i-1)
  in
  loop n