Given binary string str of size N the task is to check if the given string is valid or not. A string is called valid if the number of 0's equals the number of 1's and at any moment starting from the left of the string number 0's must be greater than or equals to the number of 1's.
1. The first line of the input contains a single integerT denoting the number of test cases. The description of T test cases follows.
2. The first line of each test case contains a single integer N.
3. The next line contains a binary string without spaces.
Output: For each test case, print"yes" if string is valid. Otherwise, print "no" (without quotes)
1. 1 <= T <= 100 2. 1 <= N <= 104
3. '0' <= str[i] <= '1'
Input: 2 4
Explanation: Test Case 1: String has an equal number of ones and zeros and at each index(starting from left) the number of occurrences of 0's is greater than or equals to the number of occurrences 1's.