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



int main() {
	map<string,bool> dic;
	int N; cin >> N;
	string com, s;
	for (int i = 0; i < N; i++) {
		cin >> com >> s;
		if (com[0] == 'i') {
			dic[s] = true;
		}
		else {
			if (dic[s])cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
}
