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

int main() {
    set<string> S;
    int n; cin >> n;
    while (n--) {
        string com, word;
        cin >> com >> word;
        if (com[0] == 'i') {
            S.insert(word);
        } else {
            cout << (S.count(word) ? "yes" : "no") << endl;
        }
    }
    return 0;
}
