You are given a $$$1$$$-indexed array $$$a$$$ of length $$$n$$$ where each element is $$$1$$$ or $$$2$$$.
Process $$$q$$$ queries of the following two types:
$$$^{\dagger}$$$ An array $$$b$$$ is a subarray of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. In particular, an array is a subarray of itself.
Each test contains multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$q$$$ ($$$1\le n,q\le 10^5$$$) — the length of array $$$a$$$ and the number of queries.
The second line of each test case contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$a_i$$$ is $$$1$$$ or $$$2$$$) — the elements of array $$$a$$$.
Each of the following $$$q$$$ lines of each test case contains some integers. The first integer $$$\mathrm{op}$$$ is either $$$1$$$ or $$$2$$$.
It is guaranteed that the sum of $$$n$$$ and the sum of $$$q$$$ over all test cases both do not exceed $$$10^5$$$.
For each query with $$$\mathrm{op}=1$$$, output "YES" in one line if there exists a subarray of $$$a$$$ whose sum is equals to $$$s$$$, otherwise output "NO".
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
25 52 1 2 1 21 51 61 72 4 21 73 22 2 21 61 5
YES YES NO YES YES NO
Consider the first example:
Name |
---|