#include <iostream>
#include <set>
#include <string>
using namespace std;

int main() {
	int n;
	cin >> n;
	set<string> tmp1;
	for (int i = 0; i < n; ++i) {
		string tmp2, str;
		cin >> tmp2 >> str;
		if (tmp2 == "find") {
			if (tmp1.count(str)) cout << "yes";
			else cout << "no";
			cout << endl;
		}
		else tmp1.insert(str);
	}
}
