#include<iostream>
#include<string>
#include<set>
int main() {
	std::string cmd, str;
	std::set<std::string> mp;
	int n, i;
	std::cin >> n;
	for (i = 0; i < n; i++) {
		std::cin >> cmd >> str;
		if (cmd == "insert") mp.insert(str);
		else if (cmd == "find") {
			if (mp.count(str) > 0) std::cout << "yes\n";
			else std::cout << "no\n";
		}
	}
	return 0;
}
