def add word
    @dic << word
    sort @dic
end

def sort arr
    word = arr.last
	i = arr.length - 1
	while arr[i - 1] > word && i > 0
		arr[i] = arr[i - 1]
		i -= 1
	end
	arr[i] = word
end

def find word
	puts binarySearch(0, @dic.length - 1, @dic, word) ? "yes" : "no"
end

def binarySearch left, right, arr, val
	mid = left + (right - left) / 2
	return true if arr[mid] == val

	if arr[mid] > val
		right = mid - 1
	else
		left = mid + 1
	end

	return false if left > right
	binarySearch(left, right, arr, val)
end

@dic = []
n = gets.to_i
n.times{
	command, word = gets.chomp.split
	case command
	when "insert"
		add word
	else
	    find word
	end
}