You're given two integers and where (k < n) , and an array of integers and a string of length , You're asked to determine if there's an interval of length k+1 which matches the pattern of string .
For example : a=[3,4,5,6,1,0,1,2] , and s=\mathtt{--+} this exists because 6>1 then and 1>0 then and 0<1 then , which matches the interval [6,1,0,1].
We consider if a_i=a_{i+1} then both of and are proper notations.
Formally , may denote and may denote and vice versa , that's
\mathtt{+} \leftrightarrow \{\mathtt{+,?}\}
\mathtt{-} \leftrightarrow \{\mathtt{-,?}\}
\mathtt{?} \leftrightarrow \{\mathtt{+,-}\}
The first line contains single integer (1 \le t \le 10^4) — the number of test cases.
The first line of each test case contains two integers (1 \le k < n \le 500) – the length of array and the length of the window.
The second line of each test case contains separated integers a_1,a_2,..,a_n (1 \le a_1,a_2,..,a_n \le 10^9) — the array .
The third line of each test case contains a string of length describing the desired interval in .
It's guaranteed that sum of n \cdot k doesn't exceed 500^2.
For each test case , print "YES" if exists ; otherwise, print "NO".
You can output the answer in any case (For example, the strings "yEs", "yes", "Yes", and "YeS" will be recognized as positive responses).
Example 1
In the first test case , the string stands for thus is a part of that string.
In the second test case , the string stands for which is also can be read as
In the third test case , the string stands for thus is a part of the string.
In the fourth test case , the string stands for thus isn't a part of the string.
In the fifth test case , the string stands for thus is a part of string because you can do following scenario:
you may decide that first character to be read as and keep the second character as
Subtask ( points) : (a_1<a_2<a_3<...<a_n)
Subtask ( points) : (s_1=s_2=...=s_k=\mathtt{?})
Subtask ( points) : (k=n-1)
Subtask ( points) : (s_i \in \{\mathtt{+,-}\})
Subtask ( points) : No additional constraints