using System;

namespace ALDS1_4_C
{
    public abstract class Array<T>
    {
        protected T[] array;
        public int Count { get; protected set; }
        public Array(int capacity)
        {
            array = new T[capacity];
            Count = 0;
        }
        public Array(int capacity, T initValue)
        {
            array = new T[capacity];
            for (int i = 0; i < capacity; ++i) array[i] = initValue;
            Count = capacity;
        }

        public T this[int i] { get { return array[i]; } }
    }

    public class List<T> : Array<T>
    {
        public static int AUTOSIZE = 1024;
        public static int INCSIZE = 1024;

        private int capacity;
        private readonly int incSize;

        public List(int capacity, int incSize) : base(capacity)
        {
            this.capacity = capacity;
            this.incSize = incSize;
        }

        public bool Contains(T element)
        {
            foreach (var e in array) if (e.Equals(element)) return true;
            return false;
        }
        public void Add(T element)
        {
            CheckCapacity();
            array[Count++] = element;
        }

        protected void CheckCapacity()
        {
            if (Count == capacity)
            {
                var newArray = new T[capacity + incSize];
                array.CopyTo(newArray, 0);
                array = newArray;
                capacity += incSize;
            }
        }
    }
    public class HashSet<T> : Array<List<T>>
    {
        public static int AUTOSIZE = 1024;
        public static int DUPLICATESIZE = 2;

        private int capacity;

        public HashSet() : base(AUTOSIZE)
        {
            capacity = AUTOSIZE;
        }
        public HashSet(int capacity) : base(capacity)
        {
            this.capacity = capacity;
        }
        public HashSet(T[] array) : base(array.Length * 2 + 1)
        {
            foreach (var e in array) Add(e);
        }

        public bool Contains(T element)
        {
            var hash = element.GetHashCode() % capacity;
            if (hash < 0) hash = (hash + capacity) % capacity;
            if (array[hash] != null)
            {
                for (int i = 0; i < array[hash].Count; ++i) if (array[hash][i].Equals(element)) return true;
            }
            return false;
        }
        public void Add(T element)
        {
            CheckCapacity();
            var hash = element.GetHashCode() % capacity;
            if (hash < 0) hash = (hash + capacity) % capacity;
            if (array[hash] == null) array[hash] = new List<T>(DUPLICATESIZE, 1);
            array[hash].Add(element);
            Count++;
        }

        protected void CheckCapacity()
        {

        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var set = new HashSet<string>(1000000);
            while (n-- > 0)
            {
                var cmd = Console.ReadLine().Split(' ');
                if (cmd[0].Equals("insert")) set.Add(cmd[1]);
                else if (cmd[0].Equals("find")) Console.WriteLine(set.Contains(cmd[1]) ? "yes" : "no");
            }
        }
    }
}

Measured memory_bytes: 90068