#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin >> t;
    map<string, int>M;
    while(t--){
        string o, v;
        cin >> o >> v;
        if(o == "insert"){
            M[v]++;
        }else if(o == "find"){
            if(M[v]){
                cout << "yes" << endl;
            }else{
                cout << "no" << endl;
            }
        }
    }
}
