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

#define FOUND '1'
#define NOT_FOUND '0'

void insert(char[12], int);
int find(char[12], int);

char word[1000000][12];

int main(){
  int n, i, j = 0;
  char a[12], b[7];

  scanf("%d",&n);

  for(i = 0; i < n; i++){
    scanf("%s",b);
    if(strcmp(b, "insert") == 0){
      scanf("%s",a);
      insert(a, j);
      j++;
    }

    else if(strcmp(b, "find") == 0){
      scanf("%s",a);
      if(find(a, j) == FOUND) printf("yes\n");
      else printf("no\n");
    }
  }
  
  return 0;
}

void insert(char a[12], int n){
  strcpy(word[n], a);
}

int find(char a[12], int n){
  int i = 0;
  
  for(i = 0; i < n; i++){
    if(strcmp(a, word[i]) == 0) return FOUND;
  }

  return NOT_FOUND;
}