#include <stdio.h>
#include <string.h>
#define MAX 1000000

void Insert( char[] );
int Find ( char[] );

char dictionary[MAX][15];
int t;

int main(){

  int n,i,j,flag,count=0;
  char word[2][15],judge[MAX][5];
  char s_1[] = "insert";
  char s_2[] = "find";
  char s_3[] = "yes";
  char s_4[] = "no";
  char s_5[] = {'\0'};

  scanf("%d",&n);

  for( i=0 ; i<n ; i++ ){
    for( j=0 ; j<2 ; j++ ){
      scanf("%s",&word[j]);
    }

    if( strcmp( word[0] , s_1 ) == 0 ){
      Insert( word[1] );
    }

    if( strcmp( word[0] , s_2 ) == 0 ){
      flag =  Find( word[1] );
    }

    if( flag == 1 ){
      strcpy( judge[count] , s_3 );
      count++;
    }
    if( flag == 0 ){
      strcpy( judge[count] , s_4 );
      count++;
    }
    strcpy( word[0] , s_5 );
    strcpy( word[1] , s_5 );
  }

  for( i=0 ; i<count ; i++ ){
    printf("%s\n",judge[i]);
  }

  return 0;

}

void Insert( char a[] ){

  strcpy( dictionary[t] , a );

  t++;
}


int Find( char b[] ){

  int i;

  for( i=0 ; i<t ; i++ ){
    if ( strcmp( dictionary[i] , b ) == 0 ) return 1;
    else continue;
  }

  return 0;
}