#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;string s, p;
    cin >> n;
    map<string, bool> T;
    for(int i = 0; i < n; i++){
        cin >> s >> p;
        if(s == "insert") T[p] = true;
        else cout << (T[p] ? "yes" : "no") << endl;

    }
    return 0;
}
