from sys import stdin
import math
# from sympy import nextprime
class hash():
    def __init__(self,n):#ｎは素数
        self.n=1000003
        self.memo=[None]*self.n
    def madekey(self,key):
        if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
    def getkey(self,KEY):
        key=""
        for S in KEY:
            key=key+self.madekey(S)
        return int(key)
    def h1(self,key):
        return key%self.n
    def h2(self,key):
        return (key%(self.n-1))+1
    def insert(self,S):
        key=self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

    def search(self,S):
        key = self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no'
n=list(map(int,(stdin.readline().strip().split())))
dic=hash(n)
for _ in range(n[0]):
    S =list(stdin.readline().strip().split())
    if S[0]=='insert':
        dic.insert(S[1])
    elif S[0]=='find':
        print(dic.search(S[1]))
 from sys import stdin import math math class hash():
    def __init__(self,n):#ｎは素数
        self.n=1000003
        self.memo=[None]*self.n
    def madekey(self,key):
        if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
    def getkey(self,KEY):
        key=""
        for S in KEY:
            key=key+self.madekey(S)
        return int(key)
    def h1(self,key):
        return key%self.n
    def h2(self,key):
        return (key%(self.n-1))+1
    def insert(self,S):
        key=self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

    def search(self,S):
        key = self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no' hash def __init__(self,n):#ｎは素数
        self.n=1000003
        self.memo=[None]*self.n
     __init__ self.n=1000003 self.n self n 1000003 self.memo=[None]*self.n self.memo self memo [None]*self.n [None] None self.n self n self self n n def madekey(self,key):
        if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
     madekey if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
     key=='A' key 'A' elif key=='C':return '2'
         key=='C' key 'C' elif key=='G':return '3'
         key=='G' key 'G' elif key=='T':return '4'
     key=='T' key 'T' self self key key def getkey(self,KEY):
        key=""
        for S in KEY:
            key=key+self.madekey(S)
        return int(key)
     getkey key="" key "" for S in KEY:
            key=key+self.madekey(S)
         S KEY key=key+self.madekey(S) key key+self.madekey(S) key self.madekey(S) self.madekey self madekey S return int(key) int(key) int key self self KEY KEY def h1(self,key):
        return key%self.n
     h1 return key%self.n key%self.n key self.n self n self self key key def h2(self,key):
        return (key%(self.n-1))+1
     h2 return (key%(self.n-1))+1 (key%(self.n-1))+1 key%(self.n-1) key self.n-1 self.n self n 1 1 self self key key def insert(self,S):
        key=self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

     insert key=self.getkey(S) key self.getkey(S) self.getkey self getkey S h1 = self.h1(key) h1 self.h1(key) self.h1 self h1 key h2 = self.h2(key) h2 self.h2(key) self.h2 self h2 key for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

     i range(0,self.n+1) range 0 self.n+1 self.n self n 1 j=(h1+(i*h2)) % self.n j (h1+(i*h2)) % self.n h1+(i*h2) h1 i*h2 i h2 self.n self n if self.memo[j] is None:
                self.memo[j]=S
                break

     self.memo[j] is None self.memo[j] self.memo self memo j None self.memo[j]=S self.memo[j] self.memo self memo j S break self self S S def search(self,S):
        key = self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no' search key = self.getkey(S) key self.getkey(S) self.getkey self getkey S h1 = self.h1(key) h1 self.h1(key) self.h1 self h1 key h2 = self.h2(key) h2 self.h2(key) self.h2 self h2 key for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no' i range(0,self.n+1) range 0 self.n+1 self.n self n 1 j = (h1+(i*h2)) % self.n j (h1+(i*h2)) % self.n h1+(i*h2) h1 i*h2 i h2 self.n self n if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no' self.memo[j] ==S self.memo[j] self.memo self memo j S return 'yes' 'yes' elif self.memo[j] is None or i ==self.n:
                return 'no' self.memo[j] is None or i ==self.n self.memo[j] is None self.memo[j] self.memo self memo j None i ==self.n i self.n self n return 'no' 'no' self self S S n=list(map(int,(stdin.readline().strip().split()))) n list(map(int,(stdin.readline().strip().split()))) list map(int,(stdin.readline().strip().split())) map int stdin.readline().strip().split() stdin.readline().strip().split stdin.readline().strip() stdin.readline().strip stdin.readline() stdin.readline stdin readline strip split dic=hash(n) dic hash(n) hash n for _ in range(n[0]):
    S =list(stdin.readline().strip().split())
    if S[0]=='insert':
        dic.insert(S[1])
    elif S[0]=='find':
        print(dic.search(S[1])) _ range(n[0]) range n[0] n 0 S =list(stdin.readline().strip().split()) S list(stdin.readline().strip().split()) list stdin.readline().strip().split() stdin.readline().strip().split stdin.readline().strip() stdin.readline().strip stdin.readline() stdin.readline stdin readline strip split if S[0]=='insert':
        dic.insert(S[1])
    elif S[0]=='find':
        print(dic.search(S[1])) S[0]=='insert' S[0] S 0 'insert' dic.insert(S[1]) dic.insert dic insert S[1] S 1 elif S[0]=='find':
        print(dic.search(S[1])) S[0]=='find' S[0] S 0 'find' print(dic.search(S[1])) print dic.search(S[1]) dic.search dic search S[1] S 1 S =list(stdin.readline().strip().split()) list(stdin.readline().strip().split()) S n=list(map(int,(stdin.readline().strip().split()))) list(map(int,(stdin.readline().strip().split()))) n class hash():
    def __init__(self,n):#ｎは素数
        self.n=1000003
        self.memo=[None]*self.n
    def madekey(self,key):
        if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
    def getkey(self,KEY):
        key=""
        for S in KEY:
            key=key+self.madekey(S)
        return int(key)
    def h1(self,key):
        return key%self.n
    def h2(self,key):
        return (key%(self.n-1))+1
    def insert(self,S):
        key=self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

    def search(self,S):
        key = self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no' class hash():
    def __init__(self,n):#ｎは素数
        self.n=1000003
        self.memo=[None]*self.n
    def madekey(self,key):
        if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
    def getkey(self,KEY):
        key=""
        for S in KEY:
            key=key+self.madekey(S)
        return int(key)
    def h1(self,key):
        return key%self.n
    def h2(self,key):
        return (key%(self.n-1))+1
    def insert(self,S):
        key=self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

    def search(self,S):
        key = self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no' hash dic=hash(n) hash(n) dic
from sys import stdin
import math
# from sympy import nextprime
class hash():
    def __init__(self,n):#ｎは素数
        self.n=1000003
        self.memo=[None]*self.n
    def madekey(self,key):
        if key=='A':return '1'
        elif key=='C':return '2'
        elif key=='G':return '3'
        elif key=='T':return '4'
    def getkey(self,KEY):
        key=""
        for S in KEY:
            key=key+self.madekey(S)
        return int(key)
    def h1(self,key):
        return key%self.n
    def h2(self,key):
        return (key%(self.n-1))+1
    def insert(self,S):
        key=self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j=(h1+(i*h2)) % self.n
            if self.memo[j] is None:
                self.memo[j]=S
                break

    def search(self,S):
        key = self.getkey(S)
        h1 = self.h1(key)
        h2 = self.h2(key)
        for i in range(0,self.n+1):
            j = (h1+(i*h2)) % self.n
            if self.memo[j] ==S:
                return 'yes'
            elif self.memo[j] is None or i ==self.n:
                return 'no'
n=list(map(int,(stdin.readline().strip().split())))
dic=hash(n)
for _ in range(n[0]):
    S =list(stdin.readline().strip().split())
    if S[0]=='insert':
        dic.insert(S[1])
    elif S[0]=='find':
        print(dic.search(S[1]))

