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

typedef long long ll;
#define mod 1000003LL
const ll base = 9973LL;

char table[mod][15];

ll hash(char *str) {
  ll h = 0, p = 1;
  int len = strlen(str);
  int i, j;

  for(i = 0; i < len; i++) {
    h = (h + str[i])*p % mod;
    p *= base; p %= mod;
  }
  
  return h;
}

ll rehash(ll hash) {
  return (hash+1) % mod;
}

void insert(char *str) { 
  int h = hash(str);
  int i;
  
  while(strlen(table[h]) > 0) h = rehash(h);

  strcpy(table[h], str);
}

int find(char *str) {
  int h = hash(str);
  while(1) {    
    if(strcmp(table[h], str) == 0) return 1;
    else if(strlen(table[h]) == 0) return 0;
    h = rehash(h);
  }
  return 0;
}

int main() {
  int n;
  char cmd[256], str[256];
  int i;

  for(i = 0; i < mod; i++) table[i][0] = '\0';
    
  scanf("%d", &n);
  for(i = 0; i < n; i++) {
    scanf("%s %s", cmd, str);
    if(strcmp(cmd, "insert") == 0) {      
      insert(str);
    } else if(strcmp(cmd, "find") == 0) {
      int flag = find(str);
      puts((flag ? "yes" : "no"));
    }
  }
  
  return 0;
}