from collections import deque, defaultdict
import sys
import math

if __name__ == '__main__':
    n = int(input())
    s = defaultdict(int)
    for _ in range(n):
        a, b = input().split()
        if a == 'insert':
            s[b] += 1
        else:
            if s[b]:
                print('yes')
            else:
                print('no') from collections import deque, defaultdict import sys sys import math math if __name__ == '__main__':
    n = int(input())
    s = defaultdict(int)
    for _ in range(n):
        a, b = input().split()
        if a == 'insert':
            s[b] += 1
        else:
            if s[b]:
                print('yes')
            else:
                print('no') __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input s = defaultdict(int) s defaultdict(int) defaultdict int for _ in range(n):
        a, b = input().split()
        if a == 'insert':
            s[b] += 1
        else:
            if s[b]:
                print('yes')
            else:
                print('no') _ range(n) range n a, b = input().split() a input().split() ().split () input split b if a == 'insert':
            s[b] += 1
        else:
            if s[b]:
                print('yes')
            else:
                print('no') a == 'insert' a 'insert' s[b] += 1 s[b] s b 1 if s[b]:
                print('yes')
            else:
                print('no') s[b] s b print('yes') print 'yes' print('no') print 'no' b = input().split() input().split() b n = int(input()) int(input()) n a, b = input().split() input().split() a s = defaultdict(int) defaultdict(int) s
from collections import deque, defaultdict
import sys
import math

if __name__ == '__main__':
    n = int(input())
    s = defaultdict(int)
    for _ in range(n):
        a, b = input().split()
        if a == 'insert':
            s[b] += 1
        else:
            if s[b]:
                print('yes')
            else:
                print('no')
