#include<bits/stdc++.h>
using namespace std;
#define int long long

map<string,int> mp;

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n; cin >> n;
  for(int i = 0; i < n; i++){
    string s,t; cin >> s >> t;
    if(s == "insert") mp[t]++;
    if(s == "find"){
      if(mp.find(t) != mp.end()) cout << "yes" << endl;
      else cout << "no" << endl; 
    }
  }

  return 0;
}

