#include <iostream>
#include <set>
#include <string>

using namespace std;

int main(void) {
	int n;
	cin >> n;
	string order;
	string str;
	typedef set<string> set_t;
	set_t A;
	while(n--) {
		cin >> order;
		if (order == "insert") {
			cin >> str;
			A.insert(str);
		} else if (order == "find") {
			cin >> str;
			if (A.count(str) == 0) cout << "no" << endl;
			else cout << "yes" << endl;
		}
	}
}

