Gold String

3.6

11 votes
Problem

Gold strings are strings of '0's and '1's that have as many 00 as 11. A string such as 00110001 consists of 3 "00" and 1 "11". Of course this is not an Gold string. 0011, 1100, 000111000111 are Gold strings. An L'th Gold number is the number of Gold strings of length L for all positive integers L.

For esoteric purposes Ankur had an oracle (a device) that was capable of answering whether a number that he entered was an Gold number. The problem is that his oracle takes too long for large numbers. Him being Ankur, he wants to ask the oracle very large numbers! You tell him that you can give him a better oracle (a program) that will tell him what he wants to know in the blink of an eye.

INPUT

  • The first Line contains a single number T, the number of test cases.
  • Each test case contains 1 positive integer N, with not more than 1000. digits.

OUTPUT

Print YES if N is an Gold number, NO otherwise.

CONSTRAINTS

  • 1T100
  • 1 ≤ Number of digits in N1000
Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?