#include <iostream>
#include <string>
#include <cstring>
using namespace std;

char stock[1000000][4];

int find(char ch[],int t)
{
  for(int i = 0;i < t;i++)
  {
    if(strcmp(ch,stock[i]) == 0) return 1;
  }
  return 0;
}

int main()
{
  int n,t = 0;
  char com[7],ch[4];

  cin >> n;
  for(int i = 0;i < n;i++)
  {
    cin >> com >> ch;

    if(com[0] == 'i')
    {
      strcpy(stock[t],ch); t++;
    }
    else if(com[0] == 'f')
    {
      if(find(ch,t)) cout << "yes" << endl;
      else cout << "no" << endl;
    }
  }

  return 0;
}

