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

#define YES 1
#define NO 0

typedef struct{
  char ope[7];
  char str[13];
}set;

int find(set *,char *);
void insert(set *,char *);

int cnt=0;

int main(){

  int i,n;
  set *A,*B;

  //入力
  scanf("%d",&n);
  A=(set *)malloc(sizeof(set)*n);
  B=(set *)malloc(sizeof(set)*n);
  for(i=0;i<n;i++)scanf("%s%s",A[i].ope,A[i].str);

  //find or insert
  for(i=0;i<n;i++){
    if(strcmp(A[i].ope,"insert")==0){
      insert(B,A[i].str);
    }else if(strcmp(A[i].ope,"find")==0){
      if(find(B,A[i].str)==YES)printf("yes\n");
      else if(find(B,A[i].str)==NO)printf("no\n");
    }
  }

  //free
  free(A);
  free(B);

  return 0;
}
int find(set *B,char *str){

    int i;
    for(i=0;i<cnt;i++)  if(strcmp(B[i].str,str)==0) return YES;
    return NO;

}
 void insert(set *B,char *str){

  strcpy(B[cnt].str,str);

  cnt++;
}