#include<stdio.h>
#include<string>
#include<math.h>
#include<algorithm>
#include<iostream>
#include<map>
using namespace std;
int main()
{
	int n;
	string a,b;
	map<string,int> t;
	cin>>n;
	while(n--)
	{
		cin>>a>>b;
		if(a[0]=='i') t[b]=1;
		else
		{
			if(t[b]) cout<<"yes"<<endl;
			else cout<<"no"<<endl;
		}
	}
	return 0;
}
