import sys
input = sys.stdin.readline

if __name__ == '__main__':
  n=int(input())
  D=[0]*n
  A=[]

  def h1(x):
    return x%n

  def h2(x):
    return 1+x%(n-1)

  def h(x,i):
    return h1(x)+i*h2(x)

  def insert(x):
    i=0
    k=0
    while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

  def find(x):
    i=0
    k=0
    while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
    return False


  def getKey(X):
    res=''
    for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
    return int(res)

  for _ in range(n):
    c,x=input().strip("\n").split()
    #x=x.replace('A','1').replace('C','2').replace('G','3').replace('T','4')
    #x=int(x)
    x=getKey(x)
    if c=='insert':
      insert(x)
    else:
      A.append(find(x))
  for ans in A:
    print('yes' if ans else 'no')
 import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline if __name__ == '__main__':
  n=int(input())
  D=[0]*n
  A=[]

  def h1(x):
    return x%n

  def h2(x):
    return 1+x%(n-1)

  def h(x,i):
    return h1(x)+i*h2(x)

  def insert(x):
    i=0
    k=0
    while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

  def find(x):
    i=0
    k=0
    while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
    return False


  def getKey(X):
    res=''
    for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
    return int(res)

  for _ in range(n):
    c,x=input().strip("\n").split()
    #x=x.replace('A','1').replace('C','2').replace('G','3').replace('T','4')
    #x=int(x)
    x=getKey(x)
    if c=='insert':
      insert(x)
    else:
      A.append(find(x))
  for ans in A:
    print('yes' if ans else 'no') __name__ == '__main__' __name__ '__main__' n=int(input()) n int(input()) int input() input D=[0]*n D [0]*n [0] 0 n A=[] A [] def h1(x):
    return x%n

   h1 return x%n x%n x n x x def h2(x):
    return 1+x%(n-1)

   h2 return 1+x%(n-1) 1+x%(n-1) 1 x%(n-1) x n-1 n 1 x x def h(x,i):
    return h1(x)+i*h2(x)

   h return h1(x)+i*h2(x) h1(x)+i*h2(x) h1(x) h1 x i*h2(x) i h2(x) h2 x x x i i def insert(x):
    i=0
    k=0
    while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

   insert i=0 i 0 k=0 k 0 while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

   True k=h(x,i)%n k h(x,i)%n h(x,i) h x i n if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
       D[k]==0 D[k] D k 0 D[k]=x D[k] D k x return k k elif D[k]==x:
        return k
       D[k]==x D[k] D k x return k k i+=1 i 1 x x def find(x):
    i=0
    k=0
    while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
    return False


   find i=0 i 0 k=0 k 0 while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
     i<n i n k=h(x,i)%n k h(x,i)%n h(x,i) h x i n if D[k]==x:
        return True
      elif D[k]==0:
        return False
       D[k]==x D[k] D k x return True True elif D[k]==0:
        return False
       D[k]==0 D[k] D k 0 return False False i+=1 i 1 return False False x x def getKey(X):
    res=''
    for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
    return int(res)

   getKey res='' res '' for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
     x X if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
     x=='A' x 'A' res+='1' res '1' elif x=='C':
        res+='2'
       x=='C' x 'C' res+='2' res '2' elif x=='G':
        res+='3'
       x=='G' x 'G' res+='3' res '3' elif x=='T':
        res+='4'
     x=='T' x 'T' res+='4' res '4' return int(res) int(res) int res X X for _ in range(n):
    c,x=input().strip("\n").split()
    #x=x.replace('A','1').replace('C','2').replace('G','3').replace('T','4')
    #x=int(x)
    x=getKey(x)
    if c=='insert':
      insert(x)
    else:
      A.append(find(x))
   _ range(n) range n c,x=input().strip("\n").split() c input().strip("\n").split() ().strip("\n").split ().strip("\n") ().strip () input strip "\n" split x x=getKey(x) x getKey(x) getKey x if c=='insert':
      insert(x)
    else:
      A.append(find(x))
   c=='insert' c 'insert' insert(x) insert x A.append(find(x)) A.append A append find(x) find x for ans in A:
    print('yes' if ans else 'no') ans A print('yes' if ans else 'no') print 'yes' if ans else 'no' ans 'yes' 'no' n=int(input()) int(input()) n x=input().strip("\n").split() input().strip("\n").split() x def find(x):
    i=0
    k=0
    while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
    return False


   def find(x):
    i=0
    k=0
    while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
    return False


   find def h2(x):
    return 1+x%(n-1)

   def h2(x):
    return 1+x%(n-1)

   h2 D=[0]*n [0]*n D def getKey(X):
    res=''
    for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
    return int(res)

   def getKey(X):
    res=''
    for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
    return int(res)

   getKey A=[] [] A def h1(x):
    return x%n

   def h1(x):
    return x%n

   h1 def h(x,i):
    return h1(x)+i*h2(x)

   def h(x,i):
    return h1(x)+i*h2(x)

   h def insert(x):
    i=0
    k=0
    while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

   def insert(x):
    i=0
    k=0
    while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

   insert input = sys.stdin.readline sys.stdin.readline input c,x=input().strip("\n").split() input().strip("\n").split() c x=getKey(x) getKey(x) x
import sys
input = sys.stdin.readline

if __name__ == '__main__':
  n=int(input())
  D=[0]*n
  A=[]

  def h1(x):
    return x%n

  def h2(x):
    return 1+x%(n-1)

  def h(x,i):
    return h1(x)+i*h2(x)

  def insert(x):
    i=0
    k=0
    while True:
      k=h(x,i)%n
      if D[k]==0:
        D[k]=x
        return k
      elif D[k]==x:
        return k
      i+=1

  def find(x):
    i=0
    k=0
    while i<n:
      k=h(x,i)%n
      if D[k]==x:
        return True
      elif D[k]==0:
        return False
      i+=1
    return False


  def getKey(X):
    res=''
    for x in X:
      if x=='A':
        res+='1'
      elif x=='C':
        res+='2'
      elif x=='G':
        res+='3'
      elif x=='T':
        res+='4'
    return int(res)

  for _ in range(n):
    c,x=input().strip("\n").split()
    #x=x.replace('A','1').replace('C','2').replace('G','3').replace('T','4')
    #x=int(x)
    x=getKey(x)
    if c=='insert':
      insert(x)
    else:
      A.append(find(x))
  for ans in A:
    print('yes' if ans else 'no')

