#include<map>
#include<iostream>
using namespace std;
int main(){
    int n,i;
    string S;
    char t[20];
    map<string,bool> mp;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>t;
        if(t[0]=='i'){
            cin>>S;
            mp[string(S)]=true;
        }
        else{
            cin>>S;
            if(mp[string(S)]) cout<<"yes"<<endl;
            else cout<<"no"<<endl;
        }
    }
}
