show that for this problem that the choice of using perm[i] or inv_perm[i] for the difference array does not matter in this solution: QED is given a permutation∗ 𝑝 of length 𝑛. He also has a string 𝑠 of length 𝑛 containing only characters 𝙻 and 𝚁. QED only likes permutations that are sorted in non-decreasing order. To sort 𝑝, he can select any of the following operations and perform them any number of times:

Choose an index 𝑖 such that 𝑠𝑖=𝙻. Then, swap 𝑝𝑖 and 𝑝𝑖−1. It is guaranteed that 𝑠1≠𝙻.
Choose an index 𝑖 such that 𝑠𝑖=𝚁. Then, swap 𝑝𝑖 and 𝑝𝑖+1. It is guaranteed that 𝑠𝑛≠𝚁.
He is also given 𝑞 queries. In each query, he selects an index 𝑖 and changes 𝑠𝑖 from 𝙻 to 𝚁 (or from 𝚁 to 𝙻). Note that the changes are persistent.

After each query, he asks you if it is possible to sort 𝑝 in non-decreasing order by performing the aforementioned operations any number of times. Note that before answering each query, the permutation 𝑝 is reset to its original form.

∗A permutation of length 𝑛 is an array consisting of 𝑛 distinct integers from 1 to 𝑛 in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array), and [1,3,4] is also not a permutation (𝑛=3 but there is 4 in the array).
Input
The first line contains 𝑡 (1≤𝑡≤104) — the number of test cases.

The first line of each test case contains two integers 𝑛 and 𝑞 (3≤𝑛≤2⋅105, 1≤𝑞≤2⋅105) – the length of the permutation and the number of queries.

The following line contains 𝑛 integers 𝑝1,𝑝2,…,𝑝𝑛 (1≤𝑝𝑖≤𝑛, 𝑝 is a permutation).

The following line contains 𝑛 characters 𝑠1𝑠2…𝑠𝑛. It is guaranteed that 𝑠𝑖 is either 𝙻 or 𝚁, 𝑠1=𝚁, and 𝑠𝑛=𝙻.

The following 𝑞 lines contain an integer 𝑖 (2≤𝑖≤𝑛−1), denoting that 𝑠𝑖 is changed from 𝙻 to 𝚁 (or from 𝚁 to 𝙻).

It is guaranteed that the sum of 𝑛 and 𝑞 over all test cases does not exceed 2⋅105.

Output
For each query, output "YES" (without quotes) if it is possible, and "NO" (without quotes) otherwise.

You can output "YES" and "NO" in any case (for example, strings "yES", "yes" and "Yes" will be recognized as a positive response).

Example
inputCopy
3
5 3
1 4 2 5 3
RLRLL
2
4
3
8 5
1 5 2 4 8 3 6 7
RRLLRRRL
4
3
5
3
4
6 2
1 2 3 4 5 6
RLRLRL
4
5
outputCopy
YES
YES
NO
NO
YES
NO
NO
NO
YES
YES
Note
In the first testcase, 𝑠=𝚁𝚁𝚁𝙻𝙻 after the first query. QED may sort 𝑝 using the following operations:

Initially, 𝑝=[1,4,2,5,3].
Select 𝑖=2 and swap 𝑝2 with 𝑝3. Now, 𝑝=[1,2,4,5,3].
Select 𝑖=5 and swap 𝑝5 with 𝑝4. Now, 𝑝=[1,2,4,3,5].
Select 𝑖=4 and swap 𝑝4 with 𝑝3. Now, 𝑝=[1,2,3,4,5], which is in non-decreasing order.
It can be shown that it is impossible to sort the array after all three updates of the first testcase. /// solution:  #include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

void solve() {
  int n, q; cin >> n >> q;
  vector<int> perm(n); for (int &x : perm) cin >> x;
  for (int i = 0; i < n; i++) perm[i]--;
  vector<int> inv_perm(n); for (int i = 0; i < n; i++) inv_perm[perm[i]] = i;

  vector<int> diff(n, 0);
  for (int i = 0; i < n; i++) {
    diff[min(perm[i], i)]++;
    diff[max(perm[i], i)]--;
  }
  // prefix diff array
  for (int i = 1; i < n; i++) diff[i] += diff[i - 1];

  string s; cin >> s;
  set<int> bad;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == 'L' && s[i + 1] == 'R' && diff[i] != 0) bad.insert(i);
  }

  while (q--) {
    int i; cin >> i; i--;
    if (s[i] == 'L') s[i] = 'R';
    else s[i] = 'L';

    if (s[i] == 'R' && s[i - 1] == 'L' && diff[i - 1] != 0) bad.insert(i - 1);
    else bad.erase(i - 1);

    if (s[i] == 'L' && s[i + 1] == 'R' && diff[i] != 0) bad.insert(i);
    else bad.erase(i);

    if (bad.empty()) cout << "YES\n";
    else cout << "NO\n";
  }

    
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) solve();
}