#include <cassert>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>

template <class Key, class Hash = std::hash<Key>,
	class Pred = std::equal_to<Key>,
	template <class> class Allocator = std::allocator>
class hashset {
	static constexpr std::size_t DefaultSize = 0x10;

public:
	using key_type = Key;
	using value_type = Key;
	using hasher = Hash;
	using key_equal = Pred;

private:
	class bucket_type {
		using value_type = typename hashset::key_type;
		typename std::aligned_storage<sizeof(value_type), alignof(value_type)>::type
			storage;

	public:
		std::uint_least8_t state; // 00:n/n  01:h/v  10:d/n
		value_type *data(){
			return static_cast<value_type *>(static_cast<void *>(&storage));
		}
		const value_type *data()const {
			return static_cast<const value_type *>(static_cast<const void *>(&storage));
		}
		explicit bucket_type() : state(0) {}
		bool has_value() const { return state & 1; }
		bool c_exp() const { return state; }
		const value_type &value() const {
			return *data();
		}
		value_type &ref() { return *data(); }
		template <class... Args> void set(Args &&... args) {
			state = 1;
			new (data()) value_type(std::forward<Args>(args)...);
		}
		void reset() {
			state = 2;
			data()->~value_type();
		}
	};

public:
	using allocator_type = Allocator<bucket_type>;
	using pointer = typename std::allocator_traits<allocator_type>::pointer;
	using const_pointer =
		typename std::allocator_traits<allocator_type>::const_pointer;
	using reference = value_type &;
	using const_reference = const value_type &;
	using size_type = std::size_t;
	using difference_type = std::ptrdiff_t;
	class iterator {
	public:
		using difference_type = typename hashset::difference_type;
		using value_type = typename hashset::value_type;
		using pointer = typename hashset::const_pointer;
		using reference = typename hashset::const_reference;

	private:
		friend hashset;
		pointer ptr;
		const pointer end;
		iterator(pointer p, pointer e) : ptr(p), end(e) {}

	public:
		reference operator*() const { return *ptr->data(); }
		pointer operator->() const { return ptr->data(); }
		iterator &operator++() {
			do
				++ptr;
			while (ptr != end && !ptr->has_value());
			return *this;
		}
		iterator operator++(int) {
			iterator old(*this);
			operator++();
			return old;
		}
		iterator &operator--() {
			do
				--ptr;
			while (!ptr->has_value());
			return *this;
		}
		iterator operator--(int) {
			iterator old(*this);
			operator--();
			return old;
		}
		bool operator==(const iterator &it) const { return ptr == it.ptr; }
		bool operator!=(const iterator &it) const { return ptr != it.ptr; }
		bool operator<(const iterator &it) const { return ptr < it.ptr; }
		bool operator<=(const iterator &it) const { return ptr <= it.ptr; }
		bool operator>(const iterator &it) const { return ptr > it.ptr; }
		bool operator>=(const iterator &it) const { return ptr >= it.ptr; }
	};
	using const_iterator = iterator;

private:
	using traits = std::allocator_traits<allocator_type>;
	using apdiff = typename traits::difference_type;
	hasher h;
	key_equal e;
	allocator_type alc;
	size_type s;
	size_type b;
	pointer p;
	void set(pointer ptr_, const pointer end_) {
		while (ptr_ != end_)
			traits::construct(alc, ptr_), ++ptr_;
	}
	void rehash_sup(const size_type n) {
		pointer succ_ = traits::allocate(alc, n);
		const pointer end_ = p + b, send_ = succ_ + n;
		set(succ_, send_);
		for (pointer ptr_ = p; ptr_ != end_; ++ptr_) {
			if (ptr_->has_value()) {
				pointer pos_ = succ_ + (h(ptr_->value()) & (n - 1));
				while (pos_->has_value()) {
					++pos_;
					if (pos_ == send_)
						pos_ = succ_;
				}
				pos_->set(std::move(ptr_->ref()));
				ptr_->reset();
			}
			traits::destroy(alc, ptr_);
		}
		traits::deallocate(alc, p, b);
		b = n;
		p = succ_;
	}

	template <class K> std::pair<iterator, bool> insert_sup(K &&k) {
		pointer pos_ = p + (h(k) & (b - 1));
		const pointer end_ = p + b;
		while (pos_->has_value()) {
			if (e(pos_->value(), k))
				return std::pair<iterator, bool>(iterator(pos_, end_), false);
			++pos_;
			if (pos_ == end_)
				pos_ = p;
		}
		pos_->set(std::forward<K>(k));
		++s;
		if (s > (b >> 1))
			rehash_sup(b << 1);
		return std::pair<iterator, bool>(iterator(pos_, end_), true);
	}

public:
	hashset() : hashset(DefaultSize) {}
	explicit hashset(const size_type n, const hasher &hf = hasher(),
		const key_equal &eql = key_equal(),
		const allocator_type &a = allocator_type())
		: h(hf), e(eql), alc(a), s(0), b(n), p(traits::allocate(alc, b)) {
		set(p, p + b);
	}

	bool empty() const noexcept { return !s; }
	size_type size() const noexcept { return s; }

	iterator begin() { return iterator(p, p + b); }
	const_iterator begin() const { return const_iterator(p, p + b); }
	iterator end() { return iterator(p + b, p + b); }
	const_iterator end() const { return const_iterator(p + b, p + b); }
	const_iterator cbegin() const { return const_iterator(p, p + b); }
	const_iterator cend() const { return const_iterator(p + b, p + b); }

	allocator_type get_allocator() const { return alc; }

	std::pair<iterator, bool> insert(const key_type &k) { return insert_sup(k); }
	std::pair<iterator, bool> insert(key_type &&k) {
		return insert_sup(std::move(k));
	}
	iterator erase(const_iterator position) {
		position.ptr->reset();
		return ++position;
	}
	size_type erase(const key_type &k) {
		pointer ptr_ = p + (h(k) & (b - 1));
		const pointer end_ = p + b;
		while (ptr_->c_exp()) {
			if (ptr_->has_value() && e(ptr_->value(), k)) {
				ptr_->reset();
				return 1;
			}
			++ptr_;
			if (ptr_ == end_)
				ptr_ = p;
		}
		return 0;
	}
	void clear() {
		const pointer end_ = p + b;
		for (pointer ptr_ = p; ptr_ != end_; ++ptr_) {
			if (ptr_->has_value())
				ptr_->reset();
			traits::destroy(alc, ptr_);
		}
		traits::deallocate(alc, p, b);
		s = 0;
		b = DefaultSize;
		p = traits::allocate(alc, b);
		set(p, p + b);
	}
	void swap(hashset &v) { std::swap(*this, v); }

	hasher hash_function() { return h; }
	key_equal key_eq() { return e; }

	iterator find(const key_type &k) {
		const_pointer ptr_ = p + (h(k) & (b - 1));
		const const_pointer end_ = p + b;
		while (ptr_->c_exp()) {
			if (ptr_->has_value() && e(ptr_->value(), k))
				return iterator(ptr_, end_);
			++ptr_;
			if (ptr_ == end_)
				ptr_ = p;
		}
		return iterator(end_, end_);
	}
	const_iterator find(const key_type &k) const {
		const_pointer ptr_ = p + (h(k) & (b - 1));
		const const_pointer end_ = p + b;
		while (ptr_->c_exp()) {
			if (ptr_->has_value() && e(ptr_->value(), k))
				return const_iterator(ptr_, end_);
			++ptr_;
			if (ptr_ == end_)
				ptr_ = p;
		}
		return const_iterator(end_, end_);
	}
	size_type count(const key_type &k) const {
		return exist(k) ? 1 : 0;
	}

	bool exist(const key_type &k) const {
		const_pointer ptr_ = p + (h(k) & (b - 1));
		const const_pointer end_ = p + b;
		while (ptr_->c_exp()) {
			if (ptr_->has_value() && e(ptr_->value(), k))
				return true;
			++ptr_;
			if (ptr_ == end_)
				ptr_ = p;
		}
		return false;
	}

	size_type bucket_count() const noexcept { return b; }

	float load_factor() const {
		return static_cast<float>(size()) / bucket_count();
	}
	void rehash() {}
	void reserve() {}
};


#include<iostream>
#include<string>


int main() {
	int n;
	std::cin >> n;
	std::string t, i;
	hashset<std::string> s;
	while (n--) {
		std::cin >> t >> i;
		if (t[0] == 'i')
			s.insert(i);
		else
			std::cout << (s.exist(i) ? "yes" : "no") << std::endl;
	}
	return 0;
}


Measured memory_bytes: 43056