#CF2236B. 鞑靼电视节目 / B. Tatar TV Show
鞑靼电视节目 / B. Tatar TV Show
B. Tatar TV Show
Source: Codeforces 2236B
Contest: Codeforces Round 1103 (Div. 3)
Time limit: 2 seconds
Memory limit: 256 megabytes
Statement
During the holidays, Egor came to visit his friend Dabir in the city of Kazan. Out of boredom, Dabir and Egor came up with a new business idea: to make their own TV show.
The format of the show is very simple: in each episode they invite a guest and play a game with them on a binary string.
In today's episode, Egor and Dabir invited Arseniy (aka MAKAN) — the main celebrity of Omsk. For the game, they chose a binary string of length and an integer .
Arseniy can make an unlimited number of moves. In one move, he can choose an integer () and invert the characters at positions and , that is, change to and to .
For example, if and , then by choosing , Arseniy inverts the characters at positions and :
Arseniy wants to get the main prize — tugriks. To do this, he needs to make the entire string equal to zero.
Help Arseniy determine whether he can get his prize, or if he will have to return to Omsk with nothing.
Input
The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and ().
The second line of each test case contains a binary string of length .
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, output "YES" if Arseniy can make the string entirely zero, and "NO" otherwise.
You can output "YES" and "NO" in any case (for example, "yES", "yes", and "Yes" will be accepted).
Examples
5
4 2
1010
3 2
111
3 3
111
3 1
110
1 1
1
YES
NO
NO
YES
NO