#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
n = int(stdin.readline())
readline = stdin.readline
d = dict()
while n:
    n -= 1
    cmd, c = readline().split()
    if cmd.startswith('i'):
        d[c] = True
    elif d.get(c):
        print('yes')
    else:
        print('no') from __future__ import division, print_function from sys import stdin n = int(stdin.readline()) n int(stdin.readline()) int stdin.readline() stdin.readline stdin readline readline = stdin.readline readline stdin.readline stdin readline d = dict() d dict() dict while n:
    n -= 1
    cmd, c = readline().split()
    if cmd.startswith('i'):
        d[c] = True
    elif d.get(c):
        print('yes')
    else:
        print('no') n n -= 1 n 1 cmd, c = readline().split() cmd readline().split() ().split () readline split c if cmd.startswith('i'):
        d[c] = True
    elif d.get(c):
        print('yes')
    else:
        print('no') cmd.startswith('i') cmd.startswith cmd startswith 'i' d[c] = True d[c] d c True elif d.get(c):
        print('yes')
     d.get(c) d.get d get c print('yes') print 'yes' print('no') print 'no' n = int(stdin.readline()) int(stdin.readline()) n c = readline().split() readline().split() c d = dict() dict() d cmd, c = readline().split() readline().split() cmd n -= 1 1 n readline = stdin.readline stdin.readline readline
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
n = int(stdin.readline())
readline = stdin.readline
d = dict()
while n:
    n -= 1
    cmd, c = readline().split()
    if cmd.startswith('i'):
        d[c] = True
    elif d.get(c):
        print('yes')
    else:
        print('no')