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

int main ()
{
	map<string, bool> M;
	
	//輸入
	int n;
	cin >> n;
	
	while(n--)
	{
		//輸入
		string cmd, str;
		cin >> cmd >> str;
		
		//處理
		if (cmd == "insert")
		{
			M[str] = true;
		}
		else
		{
			//輸出
			if (M[str]) cout << "yes\n";
			else cout << "no\n";
		}
	}
	return 0;
}
