#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1000

struct record {
  char *data;
  int isUsed;
};

struct record dict[MAX];

int hash(int seed) {
  return seed % MAX;
}

void insert(char *data) {
  int i, h = 0;

  for(i = 0;data[i] != '\0';i++)
    h += data[i];

  h = hash(h);
  i = 0;
  while(dict[h].isUsed) {
    h = hash(h + i);
    i++;
  }

  dict[h].data = (char *)malloc(strlen(data) + 1 * sizeof(char));
  strcpy(dict[h].data, data);
  dict[h].isUsed = 1;
}

int find(char *data) {
  printf("----- finding %10s -----\n", data);
  int i, h = 0;

  for(i = 0;data[i] != '\0';i++)
    h += data[i];

  h = hash(h);
  i = 1;
  while(dict[h].isUsed) {
    printf("[DEBUG] data[%d].data: %s\n", h, dict[h].data);
    if(strcmp(dict[h].data, data) == 0)
      return 1;

    h = hash(h + i);
    i++;
  }

  return 0;
}

int main() {
  int i, n;
  char operation[7], data[13];

  scanf("%d", &n);
  for(i = 0;i < n;i++) {
    scanf("%s %s", operation, data);
    switch(operation[0]) {
      case 'i':
        insert(data);
        break;
      case 'f':
        if(find(data))
          printf("yes\n");
        else
          printf("no\n");
        break;
    }
  }

  return 0;
}

