#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	dic
# CreatedDate:  2020-06-30 15:07:10 +0900
# LastModified: 2020-06-30 15:09:49 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    dic = {}
    for _ in range(n):
        command, s = input().split()
        if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no")



if __name__ == "__main__":
    main()
 import os os import sys sys def main():
    n = int(input())
    dic = {}
    for _ in range(n):
        command, s = input().split()
        if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no") main n = int(input()) n int(input()) int input() input dic = {} dic {} for _ in range(n):
        command, s = input().split()
        if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no") _ range(n) range n command, s = input().split() command input().split() ().split () input split s if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no") command == 'insert' command 'insert' dic[s] = 1 dic[s] dic s 1 print("yes" if s in dic.keys() else "no") print "yes" if s in dic.keys() else "no" s in dic.keys() s dic.keys() dic.keys dic keys "yes" "no" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    dic = {}
    for _ in range(n):
        command, s = input().split()
        if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no") def main():
    n = int(input())
    dic = {}
    for _ in range(n):
        command, s = input().split()
        if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no") main
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	dic
# CreatedDate:  2020-06-30 15:07:10 +0900
# LastModified: 2020-06-30 15:09:49 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    dic = {}
    for _ in range(n):
        command, s = input().split()
        if command == 'insert':
            dic[s] = 1
#            print(dic)
        else:
            print("yes" if s in dic.keys() else "no")



if __name__ == "__main__":
    main()

