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

#define SIZE 500000
#define WORD 13

int linearSearch(char dic[SIZE][WORD], int j, char qWord[WORD]){
  int i = 0;
  /* printf("dic[%d]:%s, j:%d, qWord:%s\n", i, dic[i], j, qWord); */
  /* strcpy(&dic[j], qWord); */
  /* for (i = 1; i < j; i++) */
  /*   printf("dic[%d]:%s\n", i, dic[i]); */
  /* i = 0; */
  while (strcmp(dic[i], qWord)) {
    i++;
    // not found
    if (j < i)
      return 0;
  }
  return 1;
}

int main(void){
  int n, i, j = 0;
  char dic[SIZE][WORD] = {{0}}, qWord[WORD] = {0};
  char cmd[WORD] = {0}, in[] = "insert", fi[] = "find";

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", cmd);
    // insert
    if (!(strcmp(cmd, in))) {
      scanf("%s", dic[j]);
      j++;
    }
    // find
    else if (!(strcmp(cmd, fi))) {
      scanf("%s", qWord);
      if (linearSearch(dic, j, qWord))
    	printf("yes\n");
      else
    	printf("no\n");
    }
    else
      puts("Not available command!");
  }

  return 0;
}