| 8 | class Xorpalindrome |
| 9 | { |
| 10 | public static void main (String[] args) throws java.lang.Exception |
| 11 | { |
| 12 | // your code goes here |
| 13 | BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); |
| 14 | BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out)); |
| 15 | int t=Integer.parseInt(br.readLine()); |
| 16 | StringBuffer sb=new StringBuffer(); |
| 17 | while(t-->0) |
| 18 | { |
| 19 | int n=Integer.parseInt(br.readLine()); |
| 20 | String s=br.readLine(); |
| 21 | int count1=0,count2=0; |
| 22 | for(int i=0;i<s.length();i++) |
| 23 | { |
| 24 | if(s.charAt(i)=='1') |
| 25 | count1++; |
| 26 | else |
| 27 | count2++; |
| 28 | } |
| 29 | boolean flag=false; |
| 30 | if(n%2==0) |
| 31 | { |
| 32 | if(count1==count2||count1%2==0&&count2%2==0) |
| 33 | flag=true; |
| 34 | } |
| 35 | else |
| 36 | { |
| 37 | flag=true; |
| 38 | } |
| 39 | if(flag) |
| 40 | System.out.println("YES"); |
| 41 | else |
| 42 | System.out.println("NO"); |
| 43 | } |
| 44 | } |
| 45 | } |