#include<bits/stdc++.h>

int main(){
    using namespace std;
    size_t n;
    cin >> n;
    set<string> s;
    string q, S;
    for(size_t i = 0; i < n; ++i){
        cin >> q >> S;
        if(q[0] == 'i')s.insert(S);
        if(q[0] == 'f')puts(s.count(S) ? "yes" : "no");
    }
}
