#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 10000
#define NOT_FAUND -1

char insert[]="insert";
char find[]="find";
int mi=0;

void inse(char*,char);
int fin(char*,char,int);

int main(){
  char str[N][12];
  char search[N][7],lang[N][12];
  int n,i,j,k=0;

  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%s %s",search[i],lang[i]);
  }
  
  for(i=0;i<n;i++){
    if(strcmp(search[i],insert)==0){
      inse(str,search[i]);
      k++;
    }
    if(strcmp(search[i],find)==0){
      j=fin(str,search[i],k);
      if(j!=NOT_FAUND) printf("yes\n");
      else printf("no\n");
    }
  }

  return 0;
  
}

void inse(char* A,char str){
  strcpy(A[mi],str);
  mi++;
}

int fin(char* A,char str,int n){
  int i = 0;
  strcpy(A[n+1],str);
  while(strcmp(A[i],str)!=0){
    i++;
  }
  if(i==n) return NOT_FAUND;
  return i;
}