from collections import defaultdict

d = defaultdict(lambda: 0)

N = int(input())

for _ in range(N):
    ord, str = input().split()
    if ord == 'insert':
        d[str] = 1
    else:
        if str in d:
            print('yes')
        else:
            print('no') from collections import defaultdict d = defaultdict(lambda: 0) d defaultdict(lambda: 0) defaultdict lambda: 0 0 N = int(input()) N int(input()) int input() input for _ in range(N):
    ord, str = input().split()
    if ord == 'insert':
        d[str] = 1
    else:
        if str in d:
            print('yes')
        else:
            print('no') _ range(N) range N ord, str = input().split() ord input().split() ().split () input split str if ord == 'insert':
        d[str] = 1
    else:
        if str in d:
            print('yes')
        else:
            print('no') ord == 'insert' ord 'insert' d[str] = 1 d[str] d str 1 if str in d:
            print('yes')
        else:
            print('no') str in d str d print('yes') print 'yes' print('no') print 'no' ord, str = input().split() input().split() ord d = defaultdict(lambda: 0) defaultdict(lambda: 0) d N = int(input()) int(input()) N str = input().split() input().split() str
from collections import defaultdict

d = defaultdict(lambda: 0)

N = int(input())

for _ in range(N):
    ord, str = input().split()
    if ord == 'insert':
        d[str] = 1
    else:
        if str in d:
            print('yes')
        else:
            print('no')