#dict.rb
dict=Hash.new
n=STDIN.gets.split[0].to_i
n.times {
line=STDIN.gets.split
order=line[0]
arg  =line[1]
if order=="insert" then
  dict[arg]=1
elsif order=="find" 
  if dict[arg]==1
    puts "yes"
  else
    puts "no"
  end
end
}