import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no')


main() import sys sys def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no') main _ = int(input()) _ int(input()) int input() input imps = sys.stdin.readlines() imps sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines db = {} db {} for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no') imp imps c, k = imp.split(' ') c imp.split(' ') imp.split imp split ' ' k if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no') c == 'insert' c 'insert' db[k] = 0 db[k] db k 0 elif k in db:
            print('yes')
         k in db k db print('yes') print 'yes' print('no') print 'no' main() main def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no') def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no') main
import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no')


main()