class Node
  attr_accessor :left, :right, :value
  def initialize(x=nil)
    @left = self
    @right = self
    @value = x
  end
end

class Dic
  def initialize
    @top = Node.new
  end

  def solve
    ans = []
    n = gets.chomp.to_i
    n.times do
      cmd = gets.chomp
      if /insert/ =~ cmd
        insert(@top, cmd.split(' ')[1])
      else
        ans << find(@top, cmd.split(' ')[1])
      end
    end
    return ans
  end

  def insert(pt, x)
    if pt.right == @top
      if pt.left == @top
        pt.left = Node.new(x)
      else
        insert(pt.left, x)
      end
    else
      if pt.value == x
        return
      elsif pt.value > x
        if pt.left == pt
          pt.left = Node.new(x)
        else
          insert(pt.left, x)
        end
      else
        if pt.right == pt
          pt.right = Node.new(x)
        else
          insert(pt.right, x)
        end
      end
    end
  end
    
  def find(pt, x)
    if pt.right == @top
      if pt.left == @top
        return "no"
      else
        find(pt.left, x)
      end
    else
      if pt.value == x
        return "yes"
      elsif pt.value > x
        if pt.left == pt
          return "no"
        else
          find(pt.left, x)
        end
      else
        if pt.right == pt
          return "no"
        else
          find(pt.right, x)
        end
      end
    end
  end
    
end

if $0 == __FILE__
  puts Dic.new.solve
end