import std.cstream;
import std.stdio;
import std.conv;
import std.string;

void main(){
string op,s,convLine;
char[] insteadOfn = din.readLine();
int n = to!(int)(insteadOfn);
int[string] hash;

  while(n-- > 0){
    convLine = readln();
    if(convLine[0] == 'i'){
      hash[convLine[7..convLine.length-1]]=1;   
    }else{
      auto val = convLine[5..convLine.length-1] in hash;
      if(val != null){
        writeln("yes");
      }
      else{
        writeln("no");
      }
    }
  } 
}