13070 - Guuguuloo   

Description

You are given N different integers a1, a2, ..., aN.

You need to execute Q operations. There are two kinds of operations:
    1. Remove xi from a1a2, ..., aN if xi is in a.
    2. Output "Yes" if yi is in a1a2, ..., aN, otherwise output "No".

Note: be careful of the efficiency of your strategy. And we suggest you to solve this problem by not using binary search.

Input

The first line contains one integer N (1 ≤ N ≤ 105) – the number of integers you are given.

The second line contains N integers a1a2, ..., aN (1 ≤ ai ≤ 109).

The third line contains one integer Q (1 ≤ Q ≤ 105) – the number of operations you need to execute.

Then Q lines follow. The i+3-th line contains one integer typei (1 ≤ typei ≤ 2) – the type of operations you need to execute. If typei = 1 then one integer xi (1 ≤ xi ≤ 109) follows, otherwise one integer yi (1 ≤ yi ≤ 109) follows.

It's guaranteed that:

  • Every xi must be greater than or equal to the previous xi.
  • Every yi must be greater than or equal to the previous yi.
  • For the first seven testcases: 1 ≤ N ≤ 1000

Output

For every second operations output whether yi is in a1a2, ..., aN or not then.

Sample Input  Download

Sample Output  Download

Tags




Discuss