//拉链法
import java.io.*;
import java.util.Scanner;
public class Main {
//N要取大于100000的最小素数
static int N = 100003,idx;
static int[] h = new int[N]; //用于存放输入的数据
static int[] e = new int[N]; //用来存放节点的值
static int[] ne = new int[N]; //用来存放节点的next指针
public static void add(int x){
int k = (x % N + N) % N; //k为要插入的位置
e[idx] = x; //先将x这个值存下来
ne[idx] = h[k]; //头节点是h[k],先让idx指向头节点
h[k] = idx++; //再把头节点指向新节点idx,idx用完后指向下一位
}
public static boolean find(int x){
int k = (x % N + N) % N;
for (int i = h[k]; i != -1; i = ne[i]) {
if (e[i] == x) return true;
}
return false;
}
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
idx = 0;
for (int i = 0; i < N; i++) {
h[i] = -1;
}
while (n-- > 0){
String x = sc.next();
int nums = sc.nextInt();
if (x.equals("I")){
add(nums);
} else {
if (find(nums)) System.out.println("Yes");
else System.out.println("No");
}
}
}
}
//开放寻址法
package Test;
import java.io.*;
import java.util.Scanner;
public class Main {
//N要取大于100000的最小素数
static int N = 100003,idx;
static int[] h = new int[N]; //用于存放输入的数据
static int nulls = 0x3f3f3f3f;
//找到x应该插入的位置
public static int find(int x){
int k = (x % N + N) % N;
//h[k]已经被用过,但不是被x用的,需要让x往下走
while (h[k] != nulls && h[k] != x){
k++;
if (k == N) k = 0;
}
return k;
}
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
idx = 0;
for (int i = 0; i < N; i++) {
h[i] = 0x3f3f3f3f;
}
while (n-- > 0){
String x = sc.next();
int nums = sc.nextInt();
//通过find函数找到x应该放的下标
int k = find(nums);
if (x.equals("I")){
h[k] = nums;
} else {
//通过nulls判断该下标上是否有被赋值过
if (h[k] != nulls) System.out.println("Yes");
else System.out.println("No");
}
}
}
}