n = gets.chomp.to_i
map = {}

(n).times do |index|
  line = gets.chomp.split
  if (line[0][0] == 'i') then
    map[line[1]] = true
  elsif (line[0][0] == 'f') then
    puts (map.has_key?(line[1]) ? 'yes' : 'no')
  end
end