#include <bits/stdc++.h>
using namespace std;

int main(void) {
	string com, str;
	int n;
	set<string> s;
	cin >> n;
	while (n--) {
		cin >> com >> str;
		if (com == "insert") 
			s.insert(str);
		else if (com == "find") {
			if (s.find(str) != s.end())
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
	}
}
