n = STDIN.gets.split[0].to_i
h = Hash.new
n.times {
  line = STDIN.gets.split
  command = line[0]
  str = line[1]
  if command == 'insert'
    h[str] = true
  elsif command == 'find'
    if h[str]
      puts 'yes'
    else
      puts 'no'
    end
  end
}
