

这里也是用数组模拟链表
//拉链法
//模拟散列表 在算法题中一般只有添加和查询不会有删除
//如果真的要删除也不是真正的删除而是打上一个标记
//mod的这个数最好取大于数据范围的第一个质数
#include<iostream>
#include<cstring>
using namespace std;
const int N = 1e5 + 3;//大于1e5的第一个质数
string op;
int h[N], e[N], ne[N], n, x, idx;
void insert(int x)
{
	int k = (x % N + N) % N;//映射,括号中modN再加上N是为了将正负数的余数都保证为正数
	e[idx] = x;
	ne[idx] = h[k];
	h[k] = idx++;
}
bool query(int x)
{
	int k = (x % N + N) % N;
	for (int i = h[k]; ~i; i = ne[i])
	{
		if (e[i] == x) return true;
	}
	return false;
}
int main()
{
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	memset(h, -1, sizeof h);//将值赋值为-1,表明节点为空
	cin >> n;
	while (n--)
	{
		cin >> op;
		if (op == "I")
		{
			cin >> x;
			insert(x);
		}
		else
		{
			cin >> x;
			if (query(x)) cout << "Yes" << '\n';
			else cout << "No" << '\n';
		}
	}
	return 0;
}
                


















