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

int main(){
    int n;
    cin >> n;
    set<string>s;
    for(int i=0;i<n;i++){
        string x,y;
        cin>>x>>y;
        if(x[0]=='i'){
            s.insert(y);
            
        }
        else{
            if(s.find(y)!=s.end())cout<<"yes\n";
            else cout<<"no\n";
        }
    }
    
}
