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

#define HASHSIZE 256
#define MAX_KW_LEN 16
#define CMND_LEN 8

#define TRUE 1
#define FALSE 0

struct list {
  char keyword[MAX_KW_LEN];
  struct list *next;
};

struct list *hashtable[HASHSIZE];

int Hash(char *key) {
  int hashval = 0;
  
  while (*key != '\0') 
    hashval += *key++;
  return (hashval % HASHSIZE); // 0 ~ HASHSIZE -1
}

int FindKeyWord(char *key) {
  struct list *p;
  
  for (p = hashtable[Hash(key)]; p != NULL; p = p->next)
    if (!strcmp(key, (*p).keyword))
      return (TRUE);
  // Not found
  return (FALSE);
}

void RegistHTable(char *key) {
  int hashval;
  struct list *p, *q;

  if ((FindKeyWord(key)) == FALSE) {
    if ((p = (struct list *)malloc(sizeof(struct list))) == NULL) {
      fprintf(stderr, "Lack of memory\n");
      exit(2);
    }

    strcpy((*p).keyword, key);
    hashval = Hash(key);
			
    if (hashtable[hashval] == NULL) {
      hashtable[hashval] = p;
      p->next = NULL;
    }
    else {
      q = hashtable[hashval];
      while (q->next != NULL)
	q = q->next;
      q->next = p;
      p->next = NULL;
    }
  }
}

void FreeKeyWord(void) {
  int i;
  struct list *p, *q;

  for (i = 0; i < HASHSIZE; i++)
    for (p = hashtable[i]; p != NULL; ) {
      q = p->next;
      free(p);
      p = q;
    }
}

int main(void) {
  char word[MAX_KW_LEN], command[CMND_LEN];
  int i, n;

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s %s", command, word);
    if (!strcmp(command, "insert")) {
      if (!(FindKeyWord(word)) == TRUE)
	RegistHTable(word);
    }
    else if (!strcmp(command, "find")) {
      if ((FindKeyWord(word)) == TRUE)
	printf("yes\n");
      else
	printf("no\n");
    }
    else
      printf("Not available command!");
  }

  FreeKeyWord(  );
  return 0;
}