n = gets(chomp:true).to_i
t = []

def h1(value, n)
  value % n
end

def h2(value, n)
  1 + (value % (n-1))
end

def h(value, i, n)
  ( h1(value, n) + i * h2(value, n) ) % n
end

def hash_insert(value, n ,t)
  i = 0
  while true
    j = h(value, i, n)
    if t[j].nil?
      t[j] = value
      break
    else
      i += 1
    end
  end
end

def hash_find(value, n ,t)
  i = 0
  while true
    j = h(value, i, n)
    if t[j] == value
      break "yes"
    elsif t[j].nil? || i >= n
      break "no"
    end
    i += 1
  end
end

(0...n).each do |i|
  order, value = gets.split.map{|a|
    if a[0] == "f"
      a = false
    elsif a[0] == "i"
      a = true
    else
      a.tr("ACGT","1234").to_i
    end
    }
  if order
    hash_insert(value, n, t)
  else
    puts hash_find(value, n, t)
  end
end
