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

typedef struct node *NodePointer;

struct node {
  char        data[13];
  NodePointer next;
};

NodePointer insert(char *);
NodePointer finditem(char *);
NodePointer make_1node(char *, NodePointer);
NodePointer head;
int j = 0;
int flag[1000000];

main(){
  int i, n;
  char order[7], data[13];
  
  head = make_1node(data, NULL);
  
  scanf("%d" ,&n);
  for(i = 0; i < n; i++){
    scanf("%s" ,order);
    scanf("%s" ,data);
    
    if(order[0] == 'i') insert(data);
    if(order[0] == 'f'){
      if( (finditem(data)) == NULL ) flag[j] = 2;
      else flag[j] = 1;
      j++;
	}
  }
  
  for(i = 0; i < j; i++){
    if(flag[i] == 1) printf("yes\n");
    if(flag[i] == 2) printf("no\n");
  }
  
  return 0;
}

NodePointer insert(char *keydata){
  NodePointer newnode ,n;

  if (finditem(keydata) == NULL) {
    newnode = make_1node(keydata, head->next);
    head->next = newnode;

    return newnode;
  }
  else {
    return NULL;
  }
}

NodePointer finditem(char *key){
  NodePointer n;

  for (n = head; n->next != NULL; n = n->next) {
    if ( (strcmp(n->next->data, key)) == 0) {
      return n;
    }
  }
  return NULL;
}

NodePointer make_1node(char *keydata, NodePointer p){
  NodePointer n;

  if ((n = malloc(sizeof(struct node))) == NULL) {
    printf("Error in memory allocation\n");
    exit(8);
  }

  strcpy(n->data, keydata);
  n->next = p;

  return n;
}