#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
//using ll = long long;
using namespace std;

int main(){
	set<string> s;
	int n;
	string in_c, in_t;
	cin >> n;
	rep(i, n){
		cin >> in_c >> in_t;
		if(in_c == "insert"){
			s.insert(in_t);
		}else if(in_c == "find"){
			if(s.count(in_t) == 0){
				cout << "no" << endl;
			}else{
				cout << "yes" << endl;
			}
		}
	}
	
	return 0;
}
