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

int main()
{
	string fir, sec;
	map<string, string> cpp;

	int q;
	cin >> q;
	while (q--)
	{
		cin >> fir >> sec;
		if (fir[0] == 'i')cpp[sec] = "yes";
		else if (fir[0] == 'f')
		{
			if (cpp.find(sec) != cpp.end())cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	return 0;
}
