
count = gets.to_i
array = []
find_array = []

count.times do
  str, val = gets.split(" ")
  if str == 'insert'
    find_array << val
  else
    if find_array.include?(val)
      array << "yes"
    else
      array << "no"
    end
  end
end
puts array