#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main()
{
  int n;
  cin >> n;
  map<string, int> mp;
  for (int i = 0; i < n; ++i)
  {
    string com, str;
    cin >> com >> str;
    if (com[0] == 'i')
      mp[str]++;
    else
    {
      if (mp[str] > 0)
        cout << "yes" << endl;
      else
        cout << "no" << endl;
    }
  }
}
