insert = ->(dic, str) {
  dic << str
}
find = ->(dic, str) {
  if dic.include?(str) then
    puts "yes"
  else
    puts "no"
  end
}

dic = []
n = gets.chomp.to_i
n.times do
  command, str = gets.chomp.split(" ")
  if command == "insert" then
    insert.call(dic, str)
  else
    find.call(dic, str)
  end
end