Alice and Bob received $$$n$$$ candies from their parents. Each candy weighs either 1 gram or 2 grams. Now they want to divide all candies among themselves fairly so that the total weight of Alice's candies is equal to the total weight of Bob's candies.Check if they can do that.Note that candies are not allowed to be cut in half.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of candies that Alice and Bob received. The next line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the weights of the candies. The weight of each candy is either $$$1$$$ or $$$2$$$. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$.

For each test case, output on a separate line:    "YES", if all candies can be divided into two sets with the same weight;  "NO" otherwise.  You can output "YES" and "NO" in any case (for example, the strings yEs, yes, Yes and YES will be recognized as positive).

NoteIn the first test case, Alice and Bob can each take one candy, then both will have a total weight of $$$1$$$.In the second test case, any division will be unfair.In the third test case, both Alice and Bob can take two candies, one of weight $$$1$$$ and one of weight $$$2$$$.In the fourth test case, it is impossible to divide three identical candies between two people.In the fifth test case, any division will also be unfair.

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = rl().split(" ");
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let len1 = arr.filter((a) => a == 1).length;
    let len2 = n - len1;

    let ar1 = len1 % 2 === 0 && len1 > 1;
    let ar2 = len2 % 2 === 0 && len2 > 1;

    if (len1 === 0 && ar2) cl("Yes");
    else if (ar1 && (ar2 || !ar2)) cl("Yes");
    else cl("No");
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = rl().split(" ");
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let len1 = 0;
    let len2 = 0;
    arr.forEach((a) => {
      a == 1 ? len1++ : len2++;
    });

    let ar1 = isEven(len1);
    let ar2 = isEven(len2);

    if (len1 === 0 && ar2) cl("Yes");
    else if (ar1 && len2 === 0) cl("Yes");
    else if (ar1 && (ar2 || !ar2)) cl("Yes");
    else cl("No");
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = numArray(rl());
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let len1 = arr.filter((a) => a === 1).length;
    let len2 = arr.filter((a) => a === 2).length;

    let ar1 = isEven(len1);
    let ar2 = isEven(len2);

    if (len1 === 0 && ar2) cl("Yes");
    else if (ar1 && len2 === 0) cl("Yes");
    else if (ar1 && (ar2 || !ar2)) cl("Yes");
    else cl("No");
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = numArray(rl());
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let len1 = arr.filter((a) => a == 1).length;
    let len2 = arr.filter((a) => a == 2).length;

    let ar1 = isEven(len1);
    let ar2 = isEven(len2);

    if (len1 == 0 && ar2) cl("Yes");
    else if (ar1 && len2 == 0) cl("Yes");
    else if (ar1 && ar2) cl("Yes");
    else if (ar1 && !ar2) cl("Yes");
    else cl("No");
  }
}

let ryan = '';//.map(Number).sort(function(a, b){return a - b})
process.stdin.on('data', c => ryan += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = ryan.split(EOL);
    var n = lines[0], e=  0
    for(j = 1; j <= n * 2; j++){
        if(j % 2 == 1){
            e = lines[j],alice = 0, bob = 0
        }else{
            k = lines[j].split(' ').map(Number).sort(function(a, b){return b - a})
                for (i = 0; i < e; i++) {
                if (alice > bob) {
                  bob += k[i]
                }
                else {
                  alice += k[i]
                }
              }

              if (alice === bob) {
                console.log('YES')
              }
              else {
                console.log('NO')
              }
        }
    }

});

let q = '';
process.stdin.on('data', c => q += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = q.split(EOL);
    var t = lines[0];
    var e = 0;
    for(i = 1; i <= t * 2; i++){
        if(i % 2 == 1){
            e = lines[i];
        }else{
            var n = lines[i].split(' ').map(Number);
            var div = 0, sum = 0, one = 0;
            for(j = 0; j < e; j++){
                if(n[j] == 1){
                    one++;
                    sum++;
                }else{
                    sum += 2;
                }
            }
            if(sum % 2 === 0){
                div = Math.floor(sum / 2);
                if(div % 2 === 0){
                    console.log('YES');
                }else{
                    if(one % 2 === 0 && one !== 0){
                        console.log('YES');
                    }else{
                        console.log('NO');
                    }
                }
            }else{
                console.log('NO');
            }
        }
    }
});

let q = '';
process.stdin.on('data', c => q += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = q.split(EOL);
    var t = lines[0];
    var e = 0;
    for(i = 1; i <= t * 2; i++){
        if(i % 2 == 1){
            e = lines[i];
        }else{
            var n = lines[i].split(' ').map(Number);
            var div = 0, sum = 0, one = 0;
            for(j = 0; j < e; j++){
                if(n[j] == 1){
                    one++;
                    sum++;
                }else{
                    sum += 2;
                }
            }
            if(sum % 2 === 0){
                div = Math.floor(sum / 2);
                if(div % 2 === 0){
                    console.log('YES');
                }else{
                    if(one){
                        console.log('YES');
                    }else{
                        console.log('NO');
                    }
                }
            }else{
                console.log('NO');
            }
        }
    }
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  let t = Number(readline());
  while (t--) {
    const n = Number(readline());
    let sum = 0;
    let candies = readline().split(' ').map(Number);
    let ones = 0;
    for (let c of candies) {
      sum += c;
      if (c === 1) ones++;
    }
    if (sum % 2 === 0) {
      if (ones === 0 && n % 2 !== 0) console.log('NO');
      else console.log('YES');
    } else {
      console.log('NO');
    }
  }
}

const { Console } = require("console");
const { RSA_X931_PADDING } = require("constants");
const { maxHeaderSize } = require("http");
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];
rl.on("line", function(line) {
    input.push(line);
}).on("close", function() {
    solution(input);
    process.exit();
});

function solution(input) {
    const array = input.slice(1).map(val => val.split(" ").map(v => Number(v)));
    let n = 0;

    for(let idx in array) {
        if(idx % 2 === 0) n = array[idx];
        else {
            let cnt1 = 0, cnt2 = 0;
            const one = array[idx].join("").match(/1/g);
            const two = array[idx].join("").match(/2/g);

            if(one !== null) cnt1 = one.length;
            if(two !== null) cnt2 = two.length;

            const sum = cnt1 + 2 * cnt2;

            if(sum % 2 !== 0) {
                console.log("NO");
            } else {
                if(cnt1 === 0) {
                    if(cnt2 % 2 === 0) console.log("YES");
                    else console.log("NO");
                } else if(cnt1 % 2 === 0 && cnt2 % 2 === 0) console.log("YES");
                else {
                    if(cnt1 % 2 === 0 && cnt2 % 2 !== 0) console.log("YES");
                    else {
                        if(cnt1 % 2 !== 0) console.log("NO");
                        else console.log("YES")
                    }
                }
            }
        }
    }
}

function sum(arr) {
    let res = 0;
    for (let a of arr) {
        res += a;
    }
    return res;
}

const countObj = (arr, val)  => arr.reduce((a, v) => (v == val ? a + 1 : a), 0);

function solve(input) {
    // YOUR BUGS HERE...
    let res = [];
    for (let el of input) {
        let ans = 'NO'
        let a = el[1].split(' ').map(i => parseInt(i));
        const sumA = eval(a.join('+'))
        if (sumA % 2 !== 0) {
            ans = 'NO'
        } else {
            const halfSum = sumA / 2;
            if (halfSum === 1 && a[0] === 1) {
                ans = 'YES';
            } else if (halfSum % 2 === 0) {
                ans = countObj(a, 2) >= (halfSum / 2) || countObj(a, 1) >= halfSum ? 'YES' : 'NO';
            } else if (halfSum % 2 !== 0) {
                ans = (countObj(a, 2) >= ((halfSum - 1) / 2) && countObj(a, 1) >= 1) || countObj(a, 1) >= halfSum ? 'YES' : 'NO'
            }
        }
        res.push(ans)
    };
    console.log(res.join('\n'));
}

/** =========== DEFAULT FORMAT ==============
 *
 * use this format to solve problem that use more than 1 inputs per testcase
 *
 *  */
function set_n_line() {
    // set return 0 if the problem needs dynamic n line inputs
    // set return n > 0 if the problem needs fixed n  line inputs
    return 2
}
const readline = require('readline').createInterface({ input: process.stdin });
let inputs = []; let sub_input = []; let t = 0; let n_line_subinput = set_n_line();
function fillInput(line) {
    // dynamic n_line
    if (n_line_subinput == 0) n_line_subinput = parseInt(line)
    else if (sub_input.length < n_line_subinput) {
        sub_input.push(line)
        if (sub_input.length == n_line_subinput) {
            inputs.push(sub_input); sub_input = [];
            n_line_subinput = set_n_line();
        }
    }
}

readline.on('line', line => {
    if (t == 0) t = parseInt(line)
    else if (inputs.length < t) {
        fillInput(line)
        if (inputs.length == t) { solve(inputs);readline.close() }
    }
});
/* =========== DEFAULT FORMAT END ============== */

function sum(arr) {
    let res = 0;
    for (let a of arr) {
        res += a;
    }
    return res;
}

const countObj = (arr, val)  => arr.reduce((a, v) => (v == val ? a + 1 : a), 0);

function solve(input) {
    // YOUR BUGS HERE...
    input.forEach(el => {
        let ans = 'NO'
        let a = el[1].split(' ').map(i => parseInt(i));
        const sumA = sum(a);
        if (sumA % 2 !== 0) {
            ans = 'NO'
        } else {
            const halfSum = sumA / 2;
            if (halfSum === 1 && a[0] === 1) {
                ans = 'YES';
            } else if (halfSum % 2 === 0) {
                ans = countObj(a, 2) >= (halfSum / 2) || countObj(a, 1) >= halfSum ? 'YES' : 'NO';
            } else if (halfSum % 2 !== 0) {
                ans = (countObj(a, 2) >= ((halfSum - 1) / 2) && countObj(a, 1) >= 1) || countObj(a, 1) >= halfSum ? 'YES' : 'NO'
            }
        }
        console.log(ans);
    });
}

/** =========== DEFAULT FORMAT ==============
 *
 * use this format to solve problem that use more than 1 inputs per testcase
 *
 *  */
function set_n_line() {
    // set return 0 if the problem needs dynamic n line inputs
    // set return n > 0 if the problem needs fixed n  line inputs
    return 2
}
const readline = require('readline').createInterface({ input: process.stdin });
let inputs = []; let sub_input = []; let t = 0; let n_line_subinput = set_n_line();
function fillInput(line) {
    // dynamic n_line
    if (n_line_subinput == 0) n_line_subinput = parseInt(line)
    else if (sub_input.length < n_line_subinput) {
        sub_input.push(line)
        if (sub_input.length == n_line_subinput) {
            inputs.push(sub_input); sub_input = [];
            n_line_subinput = set_n_line();
        }
    }
}

readline.on('line', line => {
    if (t == 0) t = parseInt(line)
    else if (inputs.length < t) {
        fillInput(line)
        if (inputs.length == t) { solve(inputs);readline.close() }
    }
});
/* =========== DEFAULT FORMAT END ============== */

let i = '';
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL).filter((line) => line);
    console.log(processInput(lines));
});

const processInput = (lines) => {
    return lines
        .slice(1)
        .filter((_, i) => i % 2)
        .map((line) => line.split(' '))
        .map((nums) => {
            const balance = nums.sort((a, b) => b - a).reduce((acc, num) => Math.abs(acc - num));
            return balance === 0 ? 'YES' : 'NO';
        })
        .join('\n');
};

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
/**
5
2
1 1
2
1 2
4
1 2 1 2
3
2 2 2
3
2 1 2

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function lcm(a, b) {
    return (a / gcd(a, b) * b);
}

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline());
    let a = readline().split(" ").map(Number);

    var sum = a.reduce((a, b) => a + b, 0);

    if (sum % 2 !== 0) {
        console.log('NO');
        return;
    }

    var half = sum / 2;
    var dp = [];

    dp[0] = true;

    for (var index = 0; index < a.length; ++ index) {
        var num = a[index];
        for (var i = half; i >= num; -- i) {
            dp[i] = dp[i] || dp[i - num];
        }
    }

    if(dp[half] === true) {
        console.log('YES');
        return;
    }

    console.log('NO');

}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	for(var i = 0; i < t; i++){
		var N = nextInt();
		var list = nextIntArray(N);
		var one = 0;
		var two = 0;
		for(var j = 0; j < N; j++){
			if(list[j] == 1){
				one++;
			}else{
				two++;
			}
		}
		if(one % 2 == 1){
			myout("NO");
			continue;
		}
		if(two % 2 == 0){
			myout("YES");
		}else{
			if(one > 0){
				myout("YES");
			}else{
				myout("NO");
			}
		}
	}
}

/*
** Template
*/

// Common Template Starts //
//*
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});

process.stdin.on("end", (_) => {
    inputString = inputString
        .trim()
        .split("\n")
        .map((string) => {
            return string.trim();
        });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Common Template Ends //

const isOdd = (x) => { return x & 1 }
const isEven = (x) => { return !(x & 1) }
const sortAsc = (arr) => arr.sort((a, b) => a - b)
const sortDesc = (arr) => arr.sort((a, b) => b - a)
const sum = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

const getResult = (n, candies) => {

    if (n === 1) return 'NO'
    if (n === 2) return (candies[0] === candies[1]) ? 'YES' : 'NO'

    totalWeight = sum(candies)
    if (isOdd(totalWeight)) return 'NO'

    let ones = candies.filter(c => c === 1)
    let twos = candies.filter(c => c === 2)

    if (ones.length === 0) return isEven(twos.length) ? 'YES' : 'NO'
    if (twos.length === 0) return isEven(ones.length) ? 'YES' : 'NO'

    sortDesc(candies)
    let mid = totalWeight / 2
    let left = 0
    let right = n - 1

    for (let i = 0; i < twos.length; i++) {
        left += twos[i]
        if (left > mid) {
            left -= twos[i]
            break
        }
    }

    for (let i = 0; i < ones.length; i++) {
        left += ones[i]
        if (left > mid) {
            left -= ones[i]
            break
        }
    }

    if (left === mid) return 'YES'

    return 'NO'
}

function main() {
    let testcases = parseInt(readline())
    while (testcases--) {

        let n = readline()
        let candies = readline()

        n = parseInt(n)
        candies = candies.split(' ').map(Number)
        console.log(getResult(n, candies))
    }
}
//*/

process.stdin.resume();
process.stdin.setEncoding("utf-8");

var standardInputString = "";
var currentLine = 0;

function readline() {
  return standardInputString[currentLine++];
}

process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});

process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  let t = +readline();
  while (t--) {
    let n = +readline();
    let arr = readline()
      .split(" ")
      .map((val) => +val);
    let count = [null, 0, 0];
    for (let i = 0; i < arr.length; ++i) {
      count[arr[i]]++;
    }
    if (count[1] % 2 !== 0) console.log("NO");
    else if (count[2] % 2 !== 0 && count[1] === 0) console.log("NO");
    else {
      console.log("YES");
    }
  }
}

const { EOL } = require('os');

let input = ''
process.stdin.on('data', data => input += data);
process.stdin.on('end', () => {
    const lines = input.split(EOL);
    let numtests = parseInt(lines[0])
    let numCandies = []
    let candyWeights = []
    for(let i=1; i<lines.length-1; i++) {
        if(i%2==1) {
            numCandies.push(parseInt(lines[i]))
        }
        else {
            candyWeights.push(lines[i].split(' '))
        }
    }
    candyWeights = candyWeights.map(x => x.map(y => parseInt(y)))
    for(let i=0; i<numCandies.length; i++) {
        if(candyWeights[i].reduce((a,b) => a + b, 0)%2===0) {
            if(candyWeights[i].length%2===0) {
                console.log('YES')
            } else {
                // number of ones needs to be even
                if(candyWeights[i].reduce((a,b) => a + (b==2? 0: 1), 0)%2==0 && candyWeights[i].reduce((a,b) => a + (b==2? 0: 1), 0)!==0) {
                    console.log('YES')
                } else {
                    console.log('NO')
                }
            }
        } else {
            console.log('NO')
        }
    }
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  const x = readline();

  for (let i = 0; i < x; i++) {
    let n = readline();
    let c = readline().split(' ').map(x => +x);
    let o = c.filter(x => x === 1);
    let t = c.filter(x => x === 2);

    if (t.length % 2 === 0 && o.length % 2 === 0) {
      console.log('yes');
    } else if (o.length > 0 && (o.length - 2) % 2 === 0 && t.length % 2 !== 0) {
      console.log('yes');
    } else {
      console.log('no');
    }
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline();
    var answer = []

    // console.log(Number(x))
    // 1 1 7
    // 6 9, 15, 18
    Array(Number(x)).fill(1).map((t, i) => {
        var n = Number(readline());
        var sum = 0
        var number = 0
        var array = readline().split(' ').map(x => {
            sum += Number(x)
            if (Number(x) === 1) number += 1
            return Number(x)
        });
        if (sum % 2 === 0 && (sum / 2) % 2 === 1 && number < 2) return console.log('NO')
        console.log(sum % 2 === 0 ? "YES" : 'NO')
    })

}

let data = '';
process.stdin.on('data', c => data += c);

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
	//your code this
	let t = nl.num();
	let ans = [];
	for(let i = 0; i < t; i++){
		nl.num();
		let k = nl.nums();
		let a = [0, 0];
		k.forEach((e) => {
			a[e-1]++;
		});
		if (a[1]%2 === 0){
			ans.push(a[0]%2 === 0);
		} else {
			ans.push(a[0] > 0 && (a[0] - 2)%2 === 0)
		}
	}
	console.log(ans.map(e => e?'YES':'NO').join('\n'));
};

process.stdin.on('end', sol);

process.stdin.resume();

process.stdin.setEncoding('utf8');

var input = '';

process.stdin.on('data' , data=>{
    input += data;
});
process.stdin.on('end' , ()=>{
    main(input);
});

function main(input) {
    input = input.split("\n");
    let z = 0;
    let testCases = +input[z++];

    while(testCases--){
        // taking input and assingn variables...
        let n = +input[z++];
        let arr = input[z++].split(' ').map(x=>Number(x));
        let total = 0;

        for (const val of arr) {
            total += val;
        }
        if(total % 2 === 1){
            console.log("NO");
        }
        else{
            if(n % 2 === 0){
                console.log("YES");
            }
            else{
                let oneCount = 0;
                let twoCount = 0;
                for (const val of arr) {
                    if(val === 1) oneCount++;
                    else twoCount++;
                }
                if(oneCount === 0 || twoCount === 0){
                    console.log("NO");
                }
                else{
                    if(oneCount % 2 === 1){
                        console.log("NO");
                    }
                    else{
                        console.log("YES");
                    }
                }
            }
        }
    }
}

const { EOL } = require('os')
let i = ''
process.stdin.on('data', c => (i += c))
process.stdin.on('end', () => {
  const { EOL } = require('os')
  const lines = i.split(EOL).filter(line => line)
  console.log(processInput(lines))
})

const processInput = lines => {
  return lines
    .slice(1)
    .filter((_, i) => i % 2)
    .map(line => line.split(' '))
    .map(nums => {
      const balance = nums
        .sort((a, b) => b - a)
        .reduce((acc, num) => Math.abs(acc - num))
      return balance === 0 ? 'YES' : 'NO'
    })
    .join(EOL)
}

const write = out => process.stdout.write(out + `\n`);

const mainCode = ([l1, l2]) => {
	l1 = Number(l1);
	l2 = l2.split(' ').map(Number);

	let ones = 0, twos = 0;
	l2.map(e => {
		if (e == 1) ones++;
		else twos++;
	})

	let total = ones + twos * 2;
	if (total % 2 != 0) write('NO');
	else {
		if ((total / 2) % 2 == 0) write('YES')
		else {
			if (ones > 0) write('YES');
			else write('NO');
		}
	}
}

let counter = 0;
let t = 0;
const t_size = 2;

const cases = [];

const lineInterpreter = (line) => {
	if (counter == 0) t = Number(line)
	else {
		const cursor = (counter - 1) % t_size
		if (cursor == 0) cases.push([line])
		else cases[cases.length - 1].push(line)
	}

	if (counter == (t * t_size)) {
		cases.map(_case => mainCode(_case))
	}
	counter++
}

const platform = 1;

if (platform > 0) {

	// FOR CODEFORCES

	process.stdin.resume();
	process.stdin.setEncoding('utf-8');

	let inputString = '';
	let currentLine = 0;

	process.stdin.on('data', inputStdin => {
	    inputString += inputStdin;
	});

	process.stdin.on('end', _ => {
	    inputString = inputString.trim().split('\n').map(string => {
	        return string.trim();
	    });

		inputString.map(line => lineInterpreter(line));
	});
} else {

	// FOR PERSONAL USE

	const sample = `5
2
1 1
2
1 2
4
1 2 1 2
3
2 2 2
3
2 1 2`;
	sample.split(`\n`).map(line => lineInterpreter(line));
}

const candies = a => {
  const countOne = a.reduce((acc, item) => {
    if (item == 1) return acc + 1;
    return acc;
  }, 0);
  const countTwo = a.length - countOne;
  if (countOne % 2 == 1) return false;
  if (countTwo % 2 == 0) return true;
  if (countOne == 0) return false;
  return true;
};

const main = () => {
  let test = parseInt(readline());
  while (test--) {
    readline();
    const a = readline()
      .split(" ")
      .map(s => parseInt(s));
    if (candies(a)) console.log("YES");
    else console.log("NO");
  }
};

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", inputStdin => {
  inputString += inputStdin;
});

process.stdin.on("end", () => {
  inputString = inputString
    .trim()
    .split("\n")
    .map(string => string.trim());
  main();
});

const readline = () => {
  return inputString[currentLine++];
};

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function getArray(str) {
    return str.split(' ').map(x => Number(x));
}

function getInt(str) {
    return Number(str);
}

function getStrArray(str) {
    return str.split(' ').map(x => x);
}

function create2DArray(rows) {
    var arr = [];

    for (var i = 0; i < rows; i++) {
        arr[i] = [];
    }

    return arr;
}
// ---------------------------------------

function main() {
    let t = getInt(readline());
    while(t--) {
        let len = getInt(readline());
        let arr = getArray(readline());
        let total1 = 0;
        let total2 = 0;
        for(let i=0; i<len; i++) {
            if(arr[i] === 1) {
                total1++;
            } else {
                total2++;
            }
        }
        if(total1%2 !== 0) {
            console.log('NO');
        } else {
            let total = total1 + 2*total2;
            if (total1 == 0 && total2%2 ===1) {
                console.log('NO');
            }else if(total%2 === 0) {
                console.log('YES');
            } else {
                console.log('NO');
            }
        }
    }
}

/*
f(total, k) = f(total-ki, k-1)+f(total, k-1)

*/

const solve = (n, arr) => {
    if ([...new Set(arr)].length == 1) {
        if (n % 2 == 0) {
            return console.log('YES');
        } else {
            return console.log('NO');
        }
    }
    let sum = arr.reduce((a, b) => a + b);
    if (sum % 2 == 1) return console.log('NO');
    console.log('YES');
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(line.split(" ").map(x => Number(x)));
    });
    rl.on('close', () => {
        let t = input[0][0];
        let i = 1;
        while (t--) {
            let data = input.slice(i, i + 2);
            solve(data[0][0], data[1]);
            i += 2;
        }
    });
};

main()

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    return;
  }

  if (c % 2) {
    c++;
    return;
  }

  const arr = d.split(' ').map(Number).sort((a, b) => b - a);
  let alice = 0;
  let bob = 0;

  for (let i = 0; i < arr.length; i++) {
    if (alice > bob) {
      bob += arr[i];
    }
    else {
      alice += arr[i];
    }
  }

  if (alice === bob) {
    console.log('YES');
  }
  else {
    console.log('NO');
  }

  c++;
});

let inputString = '';
let currentLine = 0;
process.stdin.on('data', (data) => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map((str) => str.trim());
	main();
});
function readLine() {
	return inputString[currentLine++];
}

// utils
const MOD = 1e9 + 7;
const mod = (n) => ((n % MOD) + MOD) % MOD;
const add = (a, b) => mod(mod(a) + mod(b));
const sub = (a, b) => mod(mod(a) - mod(b));
function mul() {
	for (var a = arguments, r = a[0], i = a.length; --i; )
		r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;
	return r;
}
function inv(b) {
	for (var a = MOD, u = 0, v = 1, t; b; v = t)
		(t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);
	u %= MOD;
	return u < 0 ? u + MOD : u;
}
function pow(base, n) {
	if (n === 0) return 1;
	let p = pow(base, Math.floor(n / 2));
	let res = mul(mod(p), mod(p));
	if (n % 2 === 1) res = mul(mod(res), base);
	return res;
}
function highestOneBit(i) {
	i |= i >> 1;
	i |= i >> 2;
	i |= i >> 4;
	i |= i >> 8;
	i |= i >> 16;
	return i - (i >>> 1);
}
function permutation(arr, len, store = '', permutations = []) {
	if (store.length === len) {
		permutations.push(store);
		return;
	}
	for (let i = 0; i < arr.length; i++) {
		const newArr = [...arr];
		const newChar = newArr.splice(i, 1);
		permutation(newArr, len, store.concat(newChar), permutations);
	}
	return permutations;
}

function main() {
	let t = +readLine();
	while (t--) {
		const len = +readLine();
		const arr = readLine().split(' ').map(Number);
		const sum = arr.reduce((acc, curr) => acc + curr, 0);
		if (sum % 2 !== 0) console.log('NO');
		else {
			const target = Math.floor(sum / 2);
			const dp = [...Array(len + 1).fill(0)].map((_) => Array(target + 1).fill(0));
			for (let i = 1; i <= len; i++) {
				for (let j = 1; j <= target; j++) {
					if (arr[i - 1] <= j) {
						dp[i][j] = Math.max(arr[i - 1] + dp[i - 1][j - arr[i - 1]], dp[i - 1][j]);
					} else {
						dp[i][j] = dp[i - 1][j];
					}
				}
			}
			if (dp[len][target] === target) {
				console.log('YES');
			} else {
				console.log('NO');
			}
		}
	}
}

let i = '';
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);

    const t = parseInt(lines[0]);

    for (let i = 1; i <= t * 2; i += 2) {
        const n = parseInt(lines[i]);
        const arr = lines[i + 1].split(' ').map(num => parseInt(num));

        console.log(solve(n, arr));
    }
});

function solve(n, arr) {
    let one = 0;
    let two = 0;

    for (let i = 0; i < n; i++) {
        if (arr[i] === 1) {
            one++;
        } else {
            two++;
        }
    }

    two = two % 2;

    if (two > 0 && one < 2) {
        return 'NO';
    } else if (two > 0) {
        one -= 2;
    }

    return one % 2 > 0 ? 'NO' : 'YES';
}

w = +readline();
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number);
  ones = 0;
  tows = 0;
  for (i = 0; i < y.length; i++) {
    if (y[i] === 1) {
      ones++;
    } else {
      tows++;
    }
  }
  if (tows % 2 && ones && ones % 2 === 0) print("YES");
  else if (tows % 2 === 0 && ones % 2 === 0) {
    print("YES");
  } else print("NO");
}

var n = parseInt(readline())

  function equal() {
    var length = parseInt(readline())
    var a = readline()
      .split(" ")
      .map((data) => +data)
    var sum = 0;
    var one = 0;
    for (var i = 0; i < length; i++) {
      sum += a[i];
      if (a[i] == 1)
        one++;
    }
    if (sum % 2 !== 0) {
      return print("NO");
    }
    var temp = Math.floor(sum / 2);
    if (temp % 2 !== 0 && one < 2) {
      print("NO");
    } else {
      print("YES");
    }
  }

  while (n--) {
    equal()
  }

var t = +readline();

while (t--) {
  var n = +readline();
  var weights = readline().split(" ").map(Number);
  var arr = [0, 0];
  var sum = 0;

  for (var weight of weights) {
    sum += weight;
    arr[weight % 2] += 1;
  }
  var ones = arr[1];
  if (ones % 2 || (sum % 4 && !ones)) {
    print("NO");
    continue;
  }
  print("YES");
}

var t = +readline();

while (t--) {
  var n = +readline();
  var weights = readline().split(" ").map(Number);
  var sum_weights = weights.reduce((acc, item) => acc + item);
  var ones = 0;
  var twos = 0;
  var sum = weights[0];

  for (var i = 0; i < n; i++) {
    if (weights[i] === 1) {
      ones++;
    } else {
      twos++;
    }
  }

  if (ones % 2) {
    print("NO");
    continue;
  }

  if (sum_weights % 4 && ones === 0) {
    print("NO");
    continue;
  }
  print("YES");
}

var t =readline();
for (var i = 0 ; i < t ; i++){
    var n = readline();
    var a = readline().split(' ');
    var one = 0  , two = 0 , counter = 0;
    for(var j = 0 ; j < n ; j++){
        if(a[j] == '1'){
          one++;
          counter = counter + 1;
        }
        else{
          two++;
          counter = counter + 2;
        }
    }
    if(counter%2 !== 0){
        print('NO');
    }
    else if(one === 0 && two%2 !== 0){
        print('NO');
    }
    else if(one%2 === 0 && two%2 !== 0 || one%2 === 0 && two%2 === 0 ){
        print('YES');
    }
    else{
        print('NO');
    }
}

test = parseInt(readline());
while (test--) {
	    one = 0;
		two = 0;
	n = parseInt(readline());
    arr = readline().split(' ').map(x => +x);
	for (var i = 0; i < n; i++) {
		if (arr[i] == 1) one++;
		else two++;
	}

	if ((two % 2) && (one) && (one % 2)===0)
		print('YES');
	else if ((two % 2)===0 && (one % 2)===0) {
		print('YES');
	} else
		print('NO');

}

"use strict"

let iter = parseInt(readline());

for(let i = 0; i < iter; i++){
    let amount = parseInt(readline());
    let weigths = readline().split(" ").map(x => parseInt(x));
    let ones = 0;
    let twoes = 0;

    for(let j = 0; j < amount; j++){
        if(weigths[j] === 1){
            ones++;
        } else {
            twoes++;
        }
    }

    if(ones > 1 && twoes % 2 === 1){
        ones -= 2;
        twoes++;
    }

    if(ones % 2 === 0 && twoes % 2 === 0){
        print("YES");
    } else {
        print("NO");
    }
}

T = readline()

while (T--) {
    n = readline()
    a = readline().split(' ').map(x => +x)
    sumOne = 0;
    sumTwo = 0;
    for (i = 0; i < n; i++) {
        if(a[i]==1)
            sumOne++
        else
            sumTwo++
    }
    if (sumTwo % 2 != 0) {
        if ((sumOne % 2 == 0)&&(sumOne>1))
            print('YES')
        else
            print('NO')
    }
    else {
        if (sumOne%2==0)
            print('YES')
        else
            print('NO')
    }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = numArray(rl());
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let len1 = arr.filter((a) => a == 1).length;
    let len2 = arr.filter((a) => a == 2).length;

    let ar1 = isEven(len1);
    let ar2 = isEven(len2);

    if (len1 == 0 && ar2) cl("Yes");
    else if (ar1 && len2 == 0) cl("Yes");
    else if (ar1 && ar2) cl("Yes");
    else cl("No");
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = numArray(rl());
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let ar1 = isEven(arr.filter((a) => a == 1).length);
    let ar2 = isEven(arr.filter((a) => a == 2).length);
    if (ar1 || ar2) cl("Yes");
    else cl("No");
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = numArray(rl());
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let ar1 = isEven(arr.filter((a) => a == 1).length);
    let ar2 = isEven(arr.filter((a) => a == 2).length);

    if ((!ar1 && !ar2) || (ar1 !== 0 && !ar1 && ar2)) cl("No");
    else cl("Yes");
  }
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
let standardInputString = "";
let currentLine = 0;
function readLine() {
  return standardInputString[currentLine++];
}
process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});
process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  const numArray = (a) => a.split(" ").map((line) => +line),
    isEven = (a) => (a % 2 === 0 && a > 1 ? true : false),
    cl = console.log,
    rl = readLine,
    tc = rl();

  for (let i = 0; i < tc; i++) {
    const ln1 = rl();
    const ln2 = numArray(rl());
    solution(+ln1, ln2);
  }
  /************************Solution****************************************/
  function solution(n, arr) {
    let ar1 = isEven(arr.filter((a) => a == 1).length);
    let ar2 = isEven(arr.filter((a) => a == 2).length);

    if ((!ar1 && !ar2) || (!ar1 && ar2)) cl("No");
    else cl("Yes");
  }
}

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    for(j = 1; j <= lines[0]; j++){
        var a = lines[j]
        for(k = 2; k < a; k++){
            var b = lines[k].split(' ')
            var l = 0
            if(a == 2){
                l = b[0] + b[1]
            }else if(a == 3){
                l = b[0] + b[1] + b[2]
            } else if(a == 4){
                l = b[0] + b[1] + b[2] + b[3]
            }
            if(l % 2 === 0){
                console.log('YES')
            }else {
                console.log('NO')
            }
        }

    }
});

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    var s = false
    for(j = 1; j <= lines[0] ; j++){
            var b = lines[j+1].split(' ')
            var l = b[0] + b[1]
            if(l % 2 === 0){
                console.log('YES')
            }else{
                console.log('NO')
            }

    }
});

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    var cases = lines[0];
    var totalWeight = 0;
    for(var j = 1; j < Number(cases) + 1; j++){
        var candies = lines[j + j - 1].split(' ').map(Number);
        var weight = lines[j + j].split(' ').map(Number);
        for(k = 0; k < candies; k++){
            totalWeight = weight[j] + weight[j];
        }
        if(totalWeight % 2 === 0){
            console.log('YES');
        }
        else{
            console.log('NO');
        }
    }
});

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL); /*your input text, split by lines*/
    var cases = lines[0];
    for(var j = 1; j < Number(cases) + 1; j++){
        var candies = lines[j + j - 1].split(' ').map(Number);
        var weight = lines[j + j].split(' ').map(Number);
        var totalWeight = weight[j] + weight[j];
        if(totalWeight % 2 === 0){
            console.log('YES');
        }
        else{
            console.log('NO')
        }
    }
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  let t = Number(readline());
  while (t--) {
    const n = Number(readline());
    let sum = 0;
    let candies = readline().split(' ').map(Number);
    let ones = 0;
    for (let c of candies) {
      sum += c;
      if (c === 1) ones++;
    }
    if (
      sum % 2 === 0 &&
      ((ones === 0 && n % 2 === 0) ||
        (ones !== 0 &&
          (((ones / 2) % 2 === 1 && n - ones > 1) || (ones / 2) % 2 === 0)))
    ) {
      console.log('YES');
    } else {
      console.log('NO');
    }
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  let t = Number(readline());
  while (t--) {
    const n = Number(readline());
    let sum = 0;
    let candies = readline().split(' ').map(Number);
    let ones = 0;
    for (let c of candies) {
      sum += c;
      if (c === 1) ones++;
    }
    if (
      sum % 2 === 0 &&
      ((ones === 0 && n % 2 === 0) ||
        (ones !== 0 &&
          (((ones / 2) % 2 === 1 && n % 2 === 0) || (ones / 2) % 2 === 0)))
    ) {
      console.log('YES');
    } else {
      console.log('NO');
    }
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  let t = Number(readline());
  while (t--) {
    const n = Number(readline());
    if (n % 2 === 1) {
      console.log('NO');
    } else {
      let sum = 0;
      let candies = readline().split(' ').map(Number);
      for (let c of candies) sum += c;
      if (sum % 2 === 0) {
        console.log('YES');
      } else {
        console.log('NO');
      }
    }
  }
}

const { Console } = require("console");
const { RSA_X931_PADDING } = require("constants");
const { maxHeaderSize } = require("http");
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];
rl.on("line", function(line) {
    input.push(line);
}).on("close", function() {
    solution(input);
    process.exit();
});

function solution(input) {
    const array = input.slice(1).map(val => val.split(" ").map(v => Number(v)));
    let n = 0;

    for(let idx in array) {
        if(idx % 2 === 0) n = array[idx];
        else {
            if(n == 1) {
                console.log("NO");
            } else {
                const one = array[idx].join("").match(/1/g);
                const two = array[idx].join("").match(/2/g);
                let cnt1 = 0, cnt2 = 0;

                if(one !== null) cnt1 = one.length;
                if(two !== null) cnt2 = two.length;

                const sum = cnt1 + 2 * cnt2;

                if(sum % 2 !== 0) {
                    console.log("NO");
                } else {
                    if(cnt1 % 2 === 0 && cnt2 % 2 === 0) console.log("YES");
                    else {
                        if(cnt1 % 2 === 0 && cnt2 % 2 !== 0) console.log("YES");
                        else {
                            if(cnt1 % 2 !== 0) console.log("NO");
                            else console.log("YES")
                        }
                    }
                }
            }
        }
    }
}

const { Console } = require("console");
const { RSA_X931_PADDING } = require("constants");
const { maxHeaderSize } = require("http");
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];
rl.on("line", function(line) {
    input.push(line);
}).on("close", function() {
    solution(input);
    process.exit();
});

function solution(input) {
    const array = input.slice(1).map(val => val.split(" ").map(v => Number(v)));
    let n = 0;

    for(let idx in array) {
        let check = false;
        if(idx % 2 === 0) n = array[idx];
        else {
            if(n % 2 !== 0) {
                console.log("NO");
            } else {
                const one = array[idx].join("").match(/1/g);
                const two = array[idx].join("").match(/2/g);

                if(one !== null) check = one.length % 2 === 0 ? true : false;
                if(two !== null) check = two.length % 2 === 0 ? true : false;

                check === true ? console.log("YES") : console.log("NO");
            }
        }
    }
}

function sum(arr) {
    let res = 0;
    for (let a of arr) {
        res += a;
    }
    return res;
}

const countObj = (arr, val)  => arr.reduce((a, v) => (v == val ? a + 1 : a), 0);

function solve(input) {
    // YOUR BUGS HERE...
    input.forEach(el => {
        let ans = 'NO'
        let a = el[1].split(' ').map(i => parseInt(i));
        const sumA = sum(a);
        if (sumA % 2 !== 0) {
            ans = 'NO'
        } else {
            const halfSum = sumA / 2;
            if (halfSum === 1 && a[0] === 1) {
                ans = 'YES';
            } else if (halfSum % 2 === 0) {
                ans = countObj(a, 2) >= (halfSum / 2) || countObj(a, 1) >= halfSum ? 'YES' : 'NO';
            } else if (halfSum % 2 !== 0) {
                ans = countObj(a, 2) >= ((halfSum - 1) / 2) && countObj(a, 1) >= 1 ? 'YES' : 'NO'
            }
        }
        console.log(ans);
    });
}

/** =========== DEFAULT FORMAT ==============
 *
 * use this format to solve problem that use more than 1 inputs per testcase
 *
 *  */
function set_n_line() {
    // set return 0 if the problem needs dynamic n line inputs
    // set return n > 0 if the problem needs fixed n  line inputs
    return 2
}
const readline = require('readline').createInterface({ input: process.stdin });
let inputs = []; let sub_input = []; let t = 0; let n_line_subinput = set_n_line();
function fillInput(line) {
    // dynamic n_line
    if (n_line_subinput == 0) n_line_subinput = parseInt(line)
    else if (sub_input.length < n_line_subinput) {
        sub_input.push(line)
        if (sub_input.length == n_line_subinput) {
            inputs.push(sub_input); sub_input = [];
            n_line_subinput = set_n_line();
        }
    }
}

readline.on('line', line => {
    if (t == 0) t = parseInt(line)
    else if (inputs.length < t) {
        fillInput(line)
        if (inputs.length == t) { solve(inputs);readline.close() }
    }
});
/* =========== DEFAULT FORMAT END ============== */

let i = '';
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL).filter((line) => line);
    console.log(processInput(lines));
});

const processInput = (lines) => {
    return lines
        .slice(1)
        .filter((_, i) => i % 2)
        .map((line) => line.split(' '))
        .map((nums) => {
            const balance = nums.sort((a, b) => a - b).reduce((acc, num) => Math.abs(acc - num));
            return balance === 0 ? 'YES' : 'NO';
        })
        .join('\n');
};

let i = '';
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL).filter((line) => line);
    console.log(processInput(lines));
});

const processInput = (lines) => {
    return lines
        .slice(1)
        .filter((_, i) => i % 2)
        .map((line) => line.split(' '))
        .map((nums) => {
            let nOf1 = 0,
                nOf2 = 0;
            for (const num of nums) {
                if (num === '1') nOf1++;
                else nOf2++;
            }
            return nOf1 % 2 === 0 && nOf2 % 2 === 0 ? 'YES' : 'NO';
        })
        .join('\n');
};

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
/**
5
2
1 1
2
1 2
4
1 2 1 2
3
2 2 2
3
2 1 2

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function lcm(a, b) {
    return (a / gcd(a, b) * b);
}

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline());
    let a = readline().split(" ");

    let k = 0;
    let j = 0;

    for(let i=0;i<a.length;i++) {
        if(a[i] === '1') {
            k++;
        } else {
            j++;
        }
    }

    if(k % 2 === 0 && j % 2 === 0) {
        console.log('YES');
        return;
    }

    console.log('NO');

}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
/**
5
2
1 1
2
1 2
4
1 2 1 2
3
2 2 2
3
2 1 2

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function lcm(a, b) {
    return (a / gcd(a, b) * b);
}

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline());
    let a = readline().split(" ");

    let set = new Set(a);
    //console.log(set)
    if( n === set.size * 2) {
        console.log('YES');
        return;
    }

    console.log('NO');

}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	for(var i = 0; i < t; i++){
		var N = nextInt();
		var list = nextIntArray(N);
		var one = 0;
		var two = 0;
		var sum = list[0];
		for(var j = 1; j < N; j++){
			sum += list[j];
			list[j] += list[j - 1];
		}
		var isOK = false;
		for(var j = 0; j < N; j++){
			if(sum / 2 == list[j]){
				isOK = true;
			}
		}
		myout((isOK) ? "YES" : "NO");
	}
}

/*
** Template
*/

// Common Template Starts //
//*
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});

process.stdin.on("end", (_) => {
    inputString = inputString
        .trim()
        .split("\n")
        .map((string) => {
            return string.trim();
        });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Common Template Ends //

const isOdd = (x) => { return x & 1 }
const isEven = (x) => { return !(x & 1) }
const sortAsc = (arr) => arr.sort((a, b) => a - b)
const sum = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

function findMinDiff(arr, n) {

    let sum = 0
    let left2right = [1]
    let right2left = [1]

    for (let i = 1; i < n; i++) {
        if (arr[i] > arr[i - 1]) {
            left2right[i] = left2right[i - 1] + 1
        }
    }

    for (let i = n - 2; i >= 0; i--) {
        if (arr[i] > arr[i + 1]) {
            right2left[i] = right2left[i + 1] + 1
        }
    }

    for (let i = 0; i < n; i++) {
        sum += Math.max(left2right[i], right2left[i])
    }

    return sum
}

const getResult = (n, candies) => {

    if (n === 1) return 'NO'
    if (n === 2) return (candies[0] === candies[1]) ? 'YES' : 'NO'

    totalWeight = sum(candies)
    if (isOdd(totalWeight)) return 'NO'

    sortAsc(candies)

    let minDiff = findMinDiff(candies, n)
    return minDiff === 0 ? 'YES' : 'NO'
}

function main() {
    let testcases = parseInt(readline())
    while (testcases--) {

        let n = readline()
        let candies = readline()

        n = parseInt(n)
        candies = candies.split(' ').map(Number)
        console.log(getResult(n, candies))
    }
}
//*/

process.stdin.resume();
process.stdin.setEncoding("utf-8");

var standardInputString = "";
var currentLine = 0;

function readline() {
  return standardInputString[currentLine++];
}

process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});

process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function main() {
  let t = +readline();
  while (t--) {
    let n = +readline();
    let arr = readline()
      .split(" ")
      .map((val) => +val);
    let count = [null, 0, 0];
    for (let i = 0; i < arr.length; ++i) {
      count[arr[i]]++;
    }
    if (
      count[1] === count[2] &&
      (count[1] + count[2]) % 2 === 0 &&
      count[1] !== 1 &&
      count[2] !== 1
    ) {
      console.log("YES");
    } else if (
      (count[1] === 0 && count[2] % 2 === 0) ||
      (count[2] === 0 && count[1] % 2 === 0)
    ) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  }
}

const { EOL } = require('os');

let input = ''
process.stdin.on('data', data => input += data);
process.stdin.on('end', () => {
    const lines = input.split(EOL);
    console.log(lines)
    let numtests = parseInt(lines[0])
    let numCandies = []
    let candyWeights = []
    for(let i=1; i<lines.length-1; i++) {
        if(i%2==1) {
            numCandies.push(parseInt(lines[i]))
        }
        else {
            candyWeights.push(lines[i].split(' '))
        }
    }
    candyWeights = candyWeights.map(x => x.map(y => parseInt(y)))
    for(let i=0; i<numCandies.length; i++) {
        console.log(candyWeights[i])
        if(candyWeights[i].reduce((a,b) => a + b, 0)%2===0) {
            if(candyWeights[i].length%2===0) {
                console.log('YES')
            } else {
                // number of ones needs to be even
                if(candyWeights[i].reduce((a,b) => a + (b==2? 0: 1), 0)%2==0 && candyWeights[i].reduce((a,b) => a + (b==2? 0: 1), 0)!==0) {
                    console.log('YES')
                } else {
                    console.log('NO')
                }
            }
        } else {
            console.log('NO')
        }
    }
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  const x = readline();

  for (let i = 0; i < x; i++) {
    let n = readline();
    let c = readline().split(' ').map(x => +x);
    c.sort();

    let s1 = 0;
    let s2 = 0;

    for(let i = 0; i <= n && i + 1 <= n; i+=2) {
      s1 += c[i];
      s2 += c[i + 1];
    }

    console.log(s1 === s2 ? 'yes' : 'no');
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline();
    var answer = []

    // console.log(Number(x))
    // 1 1 7
    // 6 9, 15, 18
    Array(Number(x)).fill(1).map((t, i) => {
        var n = Number(readline());
        var sum = 0
        var array = readline().split(' ').map(x => {
            sum+=Number(x)
            return Number(x)
        });

        console.log(sum % 2 ===0 ? "YES":'NO')
    })

}

w = +readline();
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number);
  ones = 0;
  tows = 0;
  for (i = 0; i < y.length; i++) {
    if (y[i] === 1) {
      ones++;
    } else {
      tows++;
    }
  }
  if (ones === tows && ones !== 1 && tows !== 1) {
    print("YES");
  } else {
    if (
      (ones % 2 === 0 && tows % 2 === 0) ||
      (ones % 2 === 1 && tows % 2 === 1)
    ) {
      print("YES");
    } else {
      print("NO");
    }
  }
}

w = +readline();
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number);
  ones = 0;
  tows = 0;
  for (i = 0; i < y.length; i++) {
    if (y[i] === 1) {
      ones++;
    } else {
      tows++;
    }
  }
  if (ones === tows && ones !== 1 && tows !== 1) {
    print("YES");
  } else {
    if (ones % 2 === 0 && tows % 2 === 0) {
      print("YES");
    } else {
      print("NO");
    }
  }
}

w = +readline();
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number);
  ones = 0;
  for (i = 0; i < y.length; i++) {
    if (y[i] === 1) {
      ones += y[i];
    } else {
      continue;
    }
  }
  if (x / 2 === ones) {
    print("YES");
  } else {
    print("NO");
  }
}

w = +readline();
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number).sort();
  ones = 0;
  twos = 0;
  for (i = 0; i < x; i++) {
    if (y[i] === 1) {
      ones++;
    } else {
      twos++;
    }
  }
  if ((ones % 2 === 0 && twos % 2 === 0) || ones === twos) {
    print("YES");
  } else {
    print("NO");
  }
}

w = +readline();
ones = 0;
twos = 0;
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number).sort();
  for (i = 0; i < x; i++) {
    if (y[i] === 1) {
      ones++;
    } else {
      twos++;
    }
  }
  if (ones === twos) {
    print("YES");
  } else {
    print("NO");
  }
}

w = +readline();
for (j = 0; j < w; j++) {
  x = +readline();
  y = readline().split(" ").map(Number).sort();
  ones = 0;
  twos = 0;
  for (i = 0; i < x; i++) {
    if (y[i] === 1) {
      ones++;
    } else {
      twos++;
    }
  }
  if (ones === twos) {
    print("YES");
  } else {
    print("NO");
  }
}

x = +readline();
y = readline().split(" ").map(Number).sort();
ones = 0;
twos = 0;
for (i = 0; i < x; i++) {
  if (y[i] === 1) {
    ones++;
  } else {
    twos++;
  }
}
if (ones === twos) {
  print("YES");
} else {
  print("NO");
}

var n = parseInt(readline())

  function equal() {
    var length = parseInt(readline())
    var a = readline()
      .split(" ")
      .map((data) => +data)
    var sum = 0;
    var one = 0;
    for (var i = 0; i < length; i++) {
      sum += a[i];
      if (a[i] == 1)
        one++;
    }
    if (sum % 2 !== 0) {
      return print("NO");
    }
    var temp = Math.floor(sum / 2);
    if (temp >= 1 && one < 2) {
      print("NO");
    } else {
      print("YES");
    }
  }

  while (n--) {
    equal()
  }

var n = parseInt(readline())

  function equal() {
    var length = parseInt(readline())
    var a = readline()
      .split(" ")
      .map((data) => +data)
    var sum = 0;
    var one = 0;
    for (var i = 0; i < length; i++) {
      sum += a[i];
      if (a[i] == 1)
        one++;
    }
    if (sum % 2 !== 0) {
      return print("NO");
    }
    var temp = Math.floor(sum / 2);
    if (temp > 1 && one < 2) {
      print("NO");
    } else {
      print("YES");
    }
  }

  while (n--) {
    equal()
  }

var input = parseInt(readline());

  for (var i = 0; i < input; i++) {
    var n = parseInt(readline());
    var weight = readline().split(" ");

    var one = weight.filter((data) => data === "1").length;
    var two = weight.filter((data) => data === "2").length;
    if (one % 2 === 0 && (two % 2 === 0 || two === 1) && one > 0 && two > 0) {
      print("YES");
    } else if (two % 2 === 0 && two > 0 && one === 0) {
      print("YES");
    } else if (one % 2 === 0 && one > 0 && two === 0) {
      print("YES");
    } else {
      print("NO");
    }
  }

var input = parseInt(readline());

  for (var i = 0; i < input; i++) {
    var n = parseInt(readline());
    var weight = readline().split(" ");

    var one = weight.filter((data) => data === "1").length;
    var two = weight.filter((data) => data === "2").length;
    if (one % 2 === 0 && two % 2 === 0 && one !== 0 && two !== 0) {
      print("YES");
    } else if (two % 2 === 0 && two !== 0 && one === 0) {
      print("YES");
    } else if (one % 2 === 0 && one !== 0 && two === 0) {
      print("YES");
    } else {
      print("NO");
    }
  }

var t = +readline();

for(var i = 0; i < t; i++) {
    var n = +readline();
    var weights = readline().split(' ').map(Number);
    var sum_weights = weights.reduce((acc, item) => acc + item);
    var qnt_1 = 0;
    var qnt_2 = 0;

    for(var j = 0; j < n; j++) {
        if(weights[j] === '1') {
            qnt_1++;
        } else {
            qnt_2++
        }
    }

    if(sum_weights % 2 === 0) {
        if(qnt_1 % 2 === 0 && qnt_2 % 2 === 0) {
            print('YES');
        } else {
            print('NO');
        }
    } else {
        print('NO');
    }
}

'use strict'

let t = readline();
    while(t--)
    {
        let n = +readline();
        let a = readline().split(" ");
        if(a.length == 1)print("NO")
        else
        {
            a.sort();
            let i = 0, j = 0;
            while(a[i] == 1)i++;
            while(a[a.length - 1 - j] == 2)j++;
            print(((i%2 && i) || (j%2 && j))? "NO" : "YES");
        }

    }

'use strict'

let t = readline(1);
    while(t--)
    {
        let n = +readline(2);
        let a = readline("1 2").split(" ");
        a.sort();
        let i = 0, j = 0;
        while(a[i] == 1)i++;
        while(a[a.length - 1 - j] == 2)j++;
        print(((i%2 && i) || (j%2 && j))? "NO" : "YES");
    }

var t =readline();
for (var i = 0 ; i < t ; i++){
    var n = readline();
    var a = readline().split(' ');
    var one = 0  , two = 0;
    for(var j = 0 ; j < n ; j++){
        if(a[j] == '1'){
          one++;
        }
        else{
          two++;
        }
    }
    if(one%2 === 0 && two%2 === 0 ){
        print('YES');
    }
    else{
        print('NO');
    }
}

"use strict"

let iter = parseInt(readline());

for(let i = 0; i < iter; i++){
    let amount = parseInt(readline());
    let weigths = readline().split(" ").map(x => parseInt(x));
    let ones = 0;
    let twoes = 0;

    for(let j = 0; j < amount; j++){
        if(weigths[j] === 1){
            ones++;
        } else {
            twoes++;
        }
    }

    if(ones % 2 === 0 && twoes % 2 === 0){
        print("YES");
    } else {
        print("NO");
    }
}


Anya loves to watch horror movies. In the best traditions of horror, she will be visited by m ghosts tonight. Anya has lots of candles prepared for the visits, each candle can produce light for exactly t seconds. It takes the girl one second to light one candle. More formally, Anya can spend one second to light one candle, then this candle burns for exactly t seconds and then goes out and can no longer be used.For each of the m ghosts Anya knows the time at which it comes: the i-th visit will happen wi seconds after midnight, all wi's are distinct. Each visit lasts exactly one second.What is the minimum number of candles Anya should use so that during each visit, at least r candles are burning? Anya can start to light a candle at any time that is integer number of seconds from midnight, possibly, at the time before midnight. That means, she can start to light a candle integer number of seconds before midnight or integer number of seconds after a midnight, or in other words in any integer moment of time.

The first line contains three integers m, t, r (1 ≤ m, t, r ≤ 300), representing the number of ghosts to visit Anya, the duration of a candle's burning and the minimum number of candles that should burn during each visit.  The next line contains m space-separated numbers wi (1 ≤ i ≤ m, 1 ≤ wi ≤ 300), the i-th of them repesents at what second after the midnight the i-th ghost will come. All wi's are distinct, they follow in the strictly increasing order.

If it is possible to make at least r candles burn during each visit, then print the minimum number of candles that Anya needs to light for that. If that is impossible, print  - 1.

NoteAnya can start lighting a candle in the same second with ghost visit. But this candle isn't counted as burning at this visit.It takes exactly one second to light up a candle and only after that second this candle is considered burning; it means that if Anya starts lighting candle at moment x, candle is buring from second x + 1 to second x + t inclusively.In the first sample test three candles are enough. For example, Anya can start lighting them at the 3-rd, 5-th and 7-th seconds after the midnight.In the second sample test one candle is enough. For example, Anya can start lighting it one second before the midnight.In the third sample test the answer is  - 1, since during each second at most one candle can burn but Anya needs three candles to light up the room at the moment when the ghost comes.

var debug = false;

function main(lineArr) {
    var lineNum = 0;
    function readln() {
        return debug? lineArr[lineNum++] : readline();
    }
    function readints() {
       return  readln().split(' ').map(function(x) {
           return parseInt(x)
       })
    }
    function println(data) {
        debug? console.log(data) : print(data);
    }

    //***************************************
    var line = readints();
    var m = line[0], t = line[1], r = line[2];
    var arr = readints().map(function(x){return x + 301});
    var candles = new Array(701);
    var ans = 0;
    for (var i = 0; i < arr.length; i++) {
        var time = arr[i];
        var burning = 0;
        for (var j = Math.max(0, time - t); j <= time - 1; j++) {
            if (candles[j])
                burning += candles[j];
        }
        if (burning < r) {
            var lightUp = r - burning;
            ans += lightUp;
            for (var j = time - 1; j >= Math.max(0, time - t) && lightUp > 0; j--)
                if (!candles[j]) {
                    candles[j] = 1;
                    lightUp --;
                }
            if (lightUp != 0)
                break;
        }
    }
    println(i == arr.length? ans : -1);
}

if (debug) {
    fs = require('fs');
    var fn = '/Users/zisakadze/Projects/codeforces/js/input.txt'
    fs.readFile(fn, 'utf8', function (err, data) {
        if (err) {
            return console.log(err);
        }
        main(data.split("\n"));
    });
} else {
    main();
}

var debug = false;

function main(lineArr) {
    var lineNum = 0;
    function readln() {
        return debug? lineArr[lineNum++] : readline();
    }
    function readints() {
       return  readln().split(' ').map(function(x) {
           return parseInt(x)
       })
    }
    function println(data) {
        debug? console.log(data) : print(data);
    }

    //***************************************
    var line = readints();
    var m = line[0], t = line[1], r = line[2];
    var arr = readints();
    var candles = new Array(301);
    var ans = 0;
    for (var i = 0; i < arr.length; i++) {
        var time = arr[i];
        var burning = 0;
        for (var j = Math.max(0, time - t); j <= time - 1; j++) {
            if (candles[j])
                burning += candles[j];
        }
        if (burning < r) {
            var lightUp = r - burning;
            ans += lightUp;
            for (var j = time - 1; j >= Math.max(0, time - t) && lightUp > 0; j--)
                if (!candles[j]) {
                    candles[j] = 1;
                    lightUp --;
                }
            if (lightUp != 0)
                break;
        }
    }
    println(i == arr.length? ans : -1);
}

if (debug) {
    fs = require('fs');
    var fn = '/Users/zisakadze/Projects/codeforces/js/input.txt'
    fs.readFile(fn, 'utf8', function (err, data) {
        if (err) {
            return console.log(err);
        }
        main(data.split("\n"));
    });
} else {
    main();
}


Luba needs your help again! Luba has n TV sets. She knows that i-th TV set will be working from moment of time li till moment ri, inclusive.Luba wants to switch off one of TV sets in order to free the socket. Let's call some TV set redundant if after switching it off the number of integer moments of time when at least one of TV sets is working won't decrease. Luba will be very upset if she has to switch off a non-redundant TV set.Help Luba by telling her the index of some redundant TV set. If there is no any, print -1.

The first line contains one integer number n (1 ≤ n ≤ 2·105) — the number of TV sets. Then n lines follow, each of them containing two integer numbers li, ri (0 ≤ li ≤ ri ≤ 109) denoting the working time of i-th TV set.

If there is no any redundant TV set, print -1. Otherwise print the index of any redundant TV set (TV sets are indexed from 1 to n). If there are multiple answers, print any of them.

NoteConsider the first sample. Initially all integer moments of time such that at least one TV set is working are from the segment [1;7]. It's easy to see that this segment won't change if we switch off the first TV set (or the second one).Note that in the fourth sample you can switch off the second TV set, since even without it all integer moments such that any of the TV sets is working denote the segment [1;4].

 function between(x, start, end) {
        return x >= start && x <= end;
    }

    function intersects(start1, end1, start2, end2) {
        return between(start1, start2, end2) ||
            between(end1, start2, end2) ||
            between(start2, start1, end1);
    }

    function addRange(tvStart, tvEnd, nodeStart, nodeEnd, nodeIndex, tree) {
        if (tvStart === nodeStart && tvEnd === nodeEnd) {
            tree[nodeIndex] = (tree[nodeIndex] || 0) + 1;
        } else {
            var leftChildStart = nodeStart;
            var leftChildEnd = (nodeEnd + nodeStart - 1) / 2;

            if (intersects(tvStart, tvEnd, leftChildStart, leftChildEnd)) {
                addRange(Math.max(tvStart, leftChildStart), Math.min(tvEnd, leftChildEnd), leftChildStart, leftChildEnd, nodeIndex * 2 + 1, tree);
            }

            var rightChildStart = (nodeEnd + nodeStart + 1) / 2;
            var rightChildEnd = nodeEnd;
            if (intersects(tvStart, tvEnd, rightChildStart, rightChildEnd)) {
                addRange(Math.max(tvStart, rightChildStart), Math.min(tvEnd, rightChildEnd), rightChildStart, rightChildEnd, nodeIndex * 2 + 2, tree);
            }
        }
    }

    function processTree(nodeIndex, parentCount, tree) {
        if (nodeIndex >= tree.length) {
            return;
        }

        tree[nodeIndex] = (tree[nodeIndex] || 0) + parentCount;

        processTree(nodeIndex * 2 + 1, tree[nodeIndex], tree);
        processTree(nodeIndex * 2 + 2, tree[nodeIndex], tree);
    }

    function arrayMin(array, start, end) {
        return array.slice(start, end + 1).reduce(function (a, b) {
            return Math.min(a, b);
        });
    }

    // read input
    var count = parseInt(readline());

    var tvs = [];
    var tvTimes = {};
    for (var i = 0; i < count; i++) {
        var input = readline().split(' ');

        var tv = {
            start: parseInt(input[0]),
            end: parseInt(input[1])
        };

        tvs.push(tv);

        tvTimes[tv.start] = 0;
        tvTimes[tv.end] = 0;
        tvTimes[tv.end + 1] = 0;
    }

   var times = Object.keys(tvTimes);

    var timesMap = {};
    times.map((t, i) => timesMap[t] = i);

    var power = Math.ceil(Math.log2(times.length));
    var intervalsLength = 1 << power;

    var treeLength = 0;
    for (var i = 0; i <= power; i++) {
        treeLength = (treeLength << 1) + 1;
    }

    var tree = Array(treeLength);

    tvs.forEach(tv => {
        addRange(timesMap[tv.start], timesMap[tv.end], 0, intervalsLength - 1, 0, tree);
    });

    processTree(0, 0, tree);
    tree.splice(0, tree.length - intervalsLength);

    function tvIndex(tvs) {
        for (var i = 0; i < tvs.length; i++) {
            var tv = tvs[i];
            if (arrayMin(tree, timesMap[tv.start], timesMap[tv.end]) > 1) {
                return i + 1;
            }
        }

        return -1;
    }

    print(tvIndex(tvs));

function removeDuplicates(array) {
    var indexMap = {};
    var index = 0;
    var length;
    var currentIndex;
    while (index < array.length) {
        currentIndex = index;
        length = 0;

        while (currentIndex + 1 < array.length && array[currentIndex] === array[currentIndex + 1]) {
            length++;
            currentIndex++;
        }

        if (length > 0) {
            array.splice(index, length);
        }

        indexMap[array[index]] = index;
        index++;
    }

    return indexMap;
}

function between(x, start, end) {
    return x >= start && x <= end;
}

function intersects(start1, end1, start2, end2) {
    return between(start1, start2, end2) ||
        between(end1, start2, end2) ||
        between(start2, start1, end1);
}

function addRange(tvStart, tvEnd, nodeStart, nodeEnd, nodeIndex, tree) {
    if (tvStart === nodeStart && tvEnd === nodeEnd) {
        tree[nodeIndex] = (tree[nodeIndex] || 0) + 1;
    } else {
        var leftChildStart = nodeStart;
        var leftChildEnd = (nodeEnd + nodeStart - 1) / 2;

        if (intersects(tvStart, tvEnd, leftChildStart, leftChildEnd)) {
            addRange(Math.max(tvStart, leftChildStart), Math.min(tvEnd, leftChildEnd), leftChildStart, leftChildEnd, nodeIndex * 2 + 1, tree);
        }

        var rightChildStart = (nodeEnd + nodeStart + 1) / 2;
        var rightChildEnd = nodeEnd;
        if (intersects(tvStart, tvEnd, rightChildStart, rightChildEnd)) {
            addRange(Math.max(tvStart, rightChildStart), Math.min(tvEnd, rightChildEnd), rightChildStart, rightChildEnd, nodeIndex * 2 + 2, tree);
        }
    }
}

function processTree(nodeIndex, parentCount, tree) {
    if (nodeIndex >= tree.length) {
        return;
    }

    tree[nodeIndex] = (tree[nodeIndex] || 0) + parentCount;

    processTree(nodeIndex * 2 + 1, tree[nodeIndex], tree);
    processTree(nodeIndex * 2 + 2, tree[nodeIndex], tree);
}

function arrayMin(array, start, end) {
    return array.slice(start, end + 1).reduce(function (a, b) {
        return Math.min(a, b);
    });
}

// read input
var count = parseInt(readline());

var tvs = [];
var times = [];
for (var i = 0; i < count; i++) {
    var tvTimes = readline().split(' ');

    var tv = {
        start: parseInt(tvTimes[0]),
        end: parseInt(tvTimes[1])
    };

    tvs.push(tv);
    times.push(tv.start);
    times.push(tv.end);
}

times.sort((a, b) => {
    return a - b;
});
var timesMap = removeDuplicates(times);

var power = Math.ceil(Math.log2(times.length));
var intervalsLength = 1 << power;

var treeLength = 0;
for (var i = 0; i <= power; i++) {
    treeLength = (treeLength << 1) + 1;
}

var tree = Array(treeLength);

tvs.forEach(tv => {
    addRange(timesMap[tv.start], timesMap[tv.end], 0, intervalsLength - 1, 0, tree);
});

processTree(0, 0, tree);
tree.splice(0, tree.length - intervalsLength);

function tvIndex(tvs) {
    for (var i = 0; i < tvs.length; i++) {
        var tv = tvs[i];
        if (arrayMin(tree, timesMap[tv.start], timesMap[tv.end]) > 1) {
            return i + 1;
        }
    }

    return -1;
}

print(tvIndex(tvs));


You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letters except these. You have to maximize the minimal frequency of some letter (the frequency of a letter is the number of occurrences of this letter in a string). If there are several possible answers, you can print any.You have to answer $$$t$$$ independent queries.

The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$$i$$$-th query and the number of characters in the $$$i$$$-th query.

Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.

NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is acceptable (the maximum minimal frequency is $$$1$$$).In the third example query any permutation of the given answer is acceptable (the maximum minimal frequency is $$$3$$$).

var a = 'abcdefghijklmnopqrstuvwxyz'.split('');
var t = +readline(), arr = [];//кол-во реквестов
for(var j = 0; j < t; ++j) {
    var inp = readline().split(' ');
    var s = '', k = +inp[1], n = +inp[0];
    for (var i = 0; i < k && s.length < n; ++i) {
        s += a[i];
        if (i == k - 1) i = -1;
    }
    arr[j] = s;
}
for(var j = 0; j < t; ++j) {
    print(arr[j]);
}

var t = +readline();
var alphabet = 'abcdefghijklmnopqrstuvwxyz';

for(var i = 0; i < t; i++) {
    var row = readline().split(' ');
    var n = +row[0], k = +row[1];
    var r = Math.ceil(n / k);
    var s = '', sb = alphabet.slice(0, k);
    for(var j = 0; j < r; j++) {
        s += sb;
    }
    write(s.slice(0, n) + '\n');
}

var t = readline();

for(var i=0; i<t; i++){
var nk = readline().split(' ');
var n = nk[0];
var k = nk[1];
var min = (n - (n%k))/k;
output = '';

for(var j=0; j<k; j++){

for(var p=0; p<min; p++){
	output += String.fromCharCode(97+j);
}
}

for(var p=0; p<(n%k); p++){
	output = output.concat(String.fromCharCode(97));
}

print(output);
}

//var input = readline()
var k = readline()

for(var i=0; i<k; i++) {
    var n = readline().split(' ')
    var a = parseInt(n[0])
    var b = parseInt(n[1])

    var all = 'abcdefghijklmnopqrstuvwxyz'
    var h = 0
    for(var j=0; j<a; j++) {
                write(all[h])
                h++
                if(h == b){
                    h = 0
                }
        }
        print('\n')
}

t=+readline()
while(t--)
{
    a=readline().split(' ')
    n=+a[0]
    k=+a[1]
    s=""
    for (i=0;i<n;i++)
    {
        s+=String.fromCharCode(97+i%k);
    }
    print(s)
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
	};
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var t = nextInt();
  var output = new Array(t);
  var alpha = "abcdefghijklmnopqrstuvwxyz";
  for(var i = 0; i < t; i++){
    var tmp = nextIntArray();
    var N = tmp[0];
    var K = tmp[1];
    var str = "";
    for(var j = 0; j < N; j++){
      str += alpha[j % K];
    }
    output[i] = str;
  }
  myout(myconv(output, 9));
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    return;
  }

  const letters = 'abcdefghijklmnopqrstuvwxyz';
  const [n, k] = d.split(' ').map(Number);
  let ans = '';

  while (ans.length < n) {
    for (let i = 0; i < k; i++) {
      ans += letters[i];
    }
  }

  console.log(ans.slice(0, n));

  c++;
});

var t = readline();

for(var i=0; i<t; i++){
var nk = readline();
var n = nk[0];
var k = nk[2];
var min = (n - (n%k))/k;
output = '';

for(var j=0; j<k; j++){

for(var p=0; p<min; p++){
	output += String.fromCharCode(97+j);
}
}

for(var p=0; p<(n%k); p++){
	output = output.concat(String.fromCharCode(97));
}

print(output);
}

//var input = readline()
var k = readline()

for(var i=0; i<k; i++) {
    var n = readline().split(' ')
    var a = parseInt(n[0])
    var b = parseInt(n[1])
    var s = 97
          for(var j=0; j<a; j++) {
                var m = 97 + b
                var c = String.fromCharCode(s)
                print(c)
                    s++
                if(m == s){
                    s = 97
                }
        }
}

var k = readline()

for(var i=0; i<k; i++) {
    var n = readline().split(' ')
    var a = parseInt(n[0])
    var b = parseInt(n[1])
    var s = 97
          for(var j=0; j<a; j++) {
                var m = 97 + b
                var c = String.fromCharCode(s)
                write(c)
                    s++
                if(m === s){
                    s = 97
                }
        }
}

//var input = readline()
var k = readline()

for(var i=0; i<k; i++) {
    var n = readline().split(' ')
    var a = parseInt(n[0])
    var b = parseInt(n[1])

    var all = 'abcdefghijklmnopqrstuvwxyz'
    var h = 0
    for(var j=0; j<a; j++) {
                print(all[h])
                h++
                if(h == b){
                    h = 0
                }
        }
        print('\n')
}

//var input = readline()
var t = readline()

for(var i=0; i<t; i++) {
    var n = readline().split(' ')
    var a = parseInt(n[0])
    var b = parseInt(n[1])
    var k = 97
          for(var j=0; j<a; j++) {
                var m = 97 + b
                var c = String.fromCharCode(k)
                print(c)
                    k++
                if(m == k){
                    k = 97
                }
        }
}

var a = 'abcdefghiklmnopqrstuvwxyz'.split('');
var t = +readline(), arr = [];//кол-во реквестов
for(var j = 0; j < t; ++j) {
    var inp = readline().split(' ');
    var s = '', k = +inp[1], n = +inp[0];
    for (var i = 0; i < k && s.length < n; ++i) {
        s += a[i];
        if (i == k - 1) i = -1;
    }
    arr[j] = s;
}
for(var j = 0; j < t; ++j) {
    print(arr[j]);
}

var a = 'abcdefghiklmnopqrstuvwxyz'.split('');
var t = +readline();//кол-во реквестов
for(var j = 0; j < t; ++j) {
    var inp = readline().split(' ');
    var s = '', k = +inp[1], n = +inp[0];
    for (var i = 0; i < k && s.length < n; ++i) {
        s += a[i];
        if (i == k - 1) i = -1;
    }
    print(s);
}