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

char dict[MAX][13];

int h1(int seed) { return seed % MAX; }
int h2(int seed) { return 1 + (seed % (MAX - 1)); }

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

long long getKey(char *data) {
  long long sum = 0, p = 1, i;
  for(i = 0;i < strlen(data);i++) {
    sum += p * data[i];
    p *= 5;
  }

  return sum;
}

void insert(char *data) {
  long long h, i, key;
  key = getKey(data);

  for(i = 0;;i++) {
    h = (h1(key) + i * h2(key)) % MAX;

    if(strcmp(dict[h], data) == 0) {
      return;
     } else if(strlen(dict[h]) == 0) {
      strcpy(dict[h], data);
      return;
    }
  }
}

int find(char *data) {
  long long h, i, key;
  key = getKey(data);

  for(i = 0;;i++) {
    h = (h1(key) + i * h2(key)) % MAX;

    if(strcmp(dict[h], data) == 0)
      return 1;
    else if(strlen(dict[h]) == 0)
      return 0;
  }
}

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

  for(i = 0;i < MAX;i++){
    dict[i][0] = '\0';
  }

  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;
}

