class Trie
  def initialize
    @root = Hash.new
  end

  def build(str)
    node = @root
    str.each_char do |ch|
      node[ch] ||= Hash.new
      node = node[ch]
    end
    node[:end] = true
  end

  def find(str)
    node = @root
    str.each_char do |ch|
      return nil unless node = node[ch]
    end
    node[:end] && true
  end
end


def main
  n = gets.chomp.to_i
  trie = Trie.new
  (1..n).each do |ca|
    command, str = gets.chomp.split(/\s/)
    trie.build(str) if command == "insert"
    if command == "find"
      flag = trie.find str
      puts "yes"  if flag 
      puts "no" if not flag
    end
  end
end

main