Phoenix is playing with a new puzzle, which consists of $n$ identical puzzle pieces. Each puzzle piece is a right isosceles triangle as shown below.

A puzzle piece

The goal of the puzzle is to create a square using the $n$ pieces. He is allowed to rotate and move the pieces around, but none of them can overlap and all $n$ pieces must be used (of course, the square shouldn't contain any holes as well). Can he do it?


-----Input-----

The input consists of multiple test cases. The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The first line of each test case contains an integer $n$ ($1 \le n \le 10^9$) — the number of puzzle pieces.


-----Output-----

For each test case, if Phoenix can create a square with the $n$ puzzle pieces, print YES. Otherwise, print NO.


-----Examples-----

Input
3
2
4
6
Output
YES
YES
NO


-----Note-----

For $n=2$, Phoenix can create a square like this:

For $n=4$, Phoenix can create a square like this:

For $n=6$, it is impossible for Phoenix to create a square.

Difficulty: EASY
Tags: Geometry

Number theory

Mathematics

Complete search
Skill types: Complete search
Expected Time Complexity: O(N)

Starter code:

Solutions:
for _ in range(int(input())):
	n = int(input())
	if n % 2:
		print('NO')
		continue
	h = n / 2
	if h ** 0.5 == int(h ** 0.5):
		print('YES')
		continue
	if n % 4:
		print('NO')
		continue
	g = n / 4
	if g ** 0.5 == int(g ** 0.5):
		print('YES')
		continue
	else:
		print('NO')
		continue


from math import sqrt

def main(n):
	if not n % 2:
		if sqrt(n // 2).is_integer() or (not n // 2 % 2 and sqrt(n // 4).is_integer()):
			return 'YES'
		else:
			return 'NO'
	else:
		return 'NO'
t = int(input())
for _ in range(t):
	n = int(input())
	print(main(n))


import math
for i in range(int(input())):
	t = int(input())
	if t % 2 == 0 and int(math.sqrt(t // 2)) ** 2 == t // 2 or (t % 4 == 0 and int(math.sqrt(t // 4)) ** 2 == t // 4):
		print('YES')
	else:
		print('NO')


import math

def isper(n):
	z = int(math.sqrt(n))
	if z ** 2 == n:
		return True
	else:
		return False
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 != 0:
		print('NO')
	elif isper(n / 2) == True:
		print('YES')
	elif n % 4 != 0:
		print('NO')
	elif isper(n / 4) == True:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	p = n / 2
	q = n / 4
	if math.sqrt(p).is_integer() or math.sqrt(q).is_integer():
		print('YES')
	else:
		print('NO')


def solve():
	n = int(input())
	for d in [2, 4]:
		if n % d == 0 and int((n // d) ** 0.5) ** 2 == n // d:
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	print(solve())


import math
t = int(input())
for i in range(t):
	n = int(input())
	n1 = math.sqrt(n / 2)
	n2 = math.sqrt(n / 4)
	if n1 == int(n1) or n2 == int(n2):
		print('YES')
	else:
		print('NO')


t = int(input())
ans = set()
i = 1
while True:
	tem = i ** 2 * 2
	tem1 = tem * 2
	ans.add(tem)
	ans.add(tem1)
	i += 1
	if tem > 10 ** 9:
		break
while t:
	t -= 1
	n = int(input())
	if n in ans:
		print('YES')
	else:
		print('NO')


from math import floor
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n % 2:
		print('NO')
		continue
	else:
		while n % 2 == 0:
			n //= 2
		if floor(n ** 0.5) ** 2 == n:
			print('YES')
		else:
			print('NO')


import math

def canFormSquare(n):
	if n == 2 or n == 4:
		return True
	f = n / 2.0
	if isPerfectSquare(f):
		return True
	f = n / 4.0
	if isPerfectSquare(f):
		return True
	return False

def isPerfectSquare(n):
	sq = math.sqrt(n)
	if float(int(sq)) == sq:
		return True
	return False
numInputs = int(input())
out = list()
for i in range(numInputs):
	inp = int(input())
	if canFormSquare(inp):
		out.append('YES')
	else:
		out.append('NO')
for line in out:
	print(line)


import sys, math, bisect
inf = float('inf')
mod = 10 ** 9 + 7

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def SieveOfEratosthenes(n):
	ans = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			ans.append(p)
	return ans

def isSquare(x):
	y = int(math.sqrt(x))
	if y * y == x:
		return True
	return False
for _ in range(int(input())):
	n = int(input())
	x = n // 2
	y = n // 4
	if isSquare(x) and n % 2 == 0 or (isSquare(y) and n % 4 == 0):
		print('YES')
	else:
		print('NO')


t = int(input())
for z in range(t):
	n = int(input())
	c = (n / 2) ** 0.5
	d = (n / 4) ** 0.5
	if int(c) == c or int(d) == d:
		print('YES')
	else:
		print('NO')


import math as m
n = int(input())
for i in range(n):
	k = int(input())
	j = k / 2
	o = k / 4
	if int(m.sqrt(j)) == m.sqrt(j):
		print('YES')
	elif int(m.sqrt(o)) == m.sqrt(o):
		print('YES')
	else:
		print('NO')


import math
for i in range(int(input())):
	n = int(input())
	if math.sqrt(n / 2) % 1 == 0 or math.sqrt(n / 4) % 1 == 0:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	x = int(input())
	if x % 2 == 0 and ((x / 2) ** (1 / 2)).is_integer() or ((x / 4) ** (1 / 2)).is_integer():
		print('YES')
	else:
		print('NO')


from math import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	n = inp()
	(x, y) = (0, 0)
	if n % 2 == 0:
		x = n // 2
		x = x ** 0.5
	if n % 4 == 0:
		y = n // 4
		y = y ** 0.5
	if x // 1 == ceil(x) and x != 0 or (y // 1 == ceil(y) and y != 0):
		print('YES')
	else:
		print('NO')


import sys
import math

def get_array():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def get_num():
	return int(sys.stdin.readline())
t = get_num()
for i in range(t):
	n = get_num()
	if math.floor(math.sqrt(n / 4)) == math.ceil(math.sqrt(n / 4)) or math.floor(math.sqrt(n / 2)) == math.ceil(math.sqrt(n / 2)):
		print('YES')
	else:
		print('NO')


from collections import defaultdict, OrderedDict, Counter
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from queue import Queue, PriorityQueue
from heapq import *
from statistics import *
from math import sqrt, log10, log2, log, gcd, ceil, floor
import fractions
import copy
from copy import deepcopy
import sys
import io
sys.setrecursionlimit(10000)
import math
import os
import bisect
import collections
mod = int(pow(10, 9)) + 7
import random
from random import *
from time import time
import itertools
from itertools import combinations

def ncr(n, r, p=mod):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def normalncr(n, r):
	r = min(r, n - r)
	count = 1
	for i in range(n - r, n + 1):
		count *= i
	for i in range(1, r + 1):
		count //= i
	return count
inf = float('inf')
adj = defaultdict(set)
visited = defaultdict(int)

def addedge(a, b):
	adj[a].add(b)
	adj[b].add(a)

def bfs(v):
	q = Queue()
	q.put(v)
	visited[v] = 1
	while q.qsize() > 0:
		s = q.get_nowait()
		print(s)
		for i in adj[s]:
			if visited[i] == 0:
				q.put(i)
				visited[i] = 1

def dfs(v, visited):
	if visited[v] == 1:
		return
	visited[v] = 1
	print(v)
	for i in adj[v]:
		dfs(i, visited)

def reverse_bisect_right(a, x, lo=0, hi=None):
	if lo < 0:
		raise ValueError('lo must be non-negative')
	if hi is None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if x > a[mid]:
			hi = mid
		else:
			lo = mid + 1
	return lo

def reverse_bisect_left(a, x, lo=0, hi=None):
	if lo < 0:
		raise ValueError('lo must be non-negative')
	if hi is None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if x >= a[mid]:
			hi = mid
		else:
			lo = mid + 1
	return lo

def get_list():
	return list(map(int, input().split()))

def get_str_list_in_int():
	return [int(i) for i in list(input())]

def get_str_list():
	return list(input())

def get_map():
	return map(int, input().split())

def input_int():
	return int(input())

def matrix(a, b):
	return [[0 for i in range(b)] for j in range(a)]

def swap(a, b):
	return (b, a)

def find_gcd(l):
	a = l[0]
	for i in range(len(l)):
		a = gcd(a, l[i])
	return a

def is_prime(n):
	sqrta = int(sqrt(n))
	for i in range(2, sqrta + 1):
		if n % i == 0:
			return 0
	return 1

def prime_factors(n):
	while n % 2 == 0:
		return [2] + prime_factors(n // 2)
	sqrta = int(sqrt(n))
	for i in range(3, sqrta + 1, 2):
		if n % i == 0:
			return [i] + prime_factors(n // i)
	return [n]

def p(a):
	if type(a) == str:
		print(a + '\n')
	else:
		print(str(a) + '\n')

def ps(a):
	if type(a) == str:
		print(a)
	else:
		print(str(a))

def kth_no_not_div_by_n(n, k):
	return k + (k - 1) // (n - 1)

def forward_array(l):
	n = len(l)
	stack = []
	forward = [0] * n
	for i in range(len(l) - 1, -1, -1):
		while len(stack) and l[stack[-1]] < l[i]:
			stack.pop()
		if len(stack) == 0:
			forward[i] = len(l)
		else:
			forward[i] = stack[-1]
		stack.append(i)
	return forward

def backward_array(l):
	n = len(l)
	stack = []
	backward = [0] * n
	for i in range(len(l)):
		while len(stack) and l[stack[-1]] < l[i]:
			stack.pop()
		if len(stack) == 0:
			backward[i] = -1
		else:
			backward[i] = stack[-1]
		stack.append(i)
	return backward

def char(a):
	return chr(a + 97)

def get_length(a):
	return 1 + int(log10(a))

def issq(n):
	sqrta = int(n ** 0.5)
	return sqrta ** 2 == n

def ceil(a, b):
	return int((a + b - 1) / b)

def equal_sum_partition(arr, n):
	sum = 0
	for i in range(n):
		sum += arr[i]
	if sum % 2 != 0:
		return False
	part = [[True for i in range(n + 1)] for j in range(sum // 2 + 1)]
	for i in range(0, n + 1):
		part[0][i] = True
	for i in range(1, sum // 2 + 1):
		part[i][0] = False
	for i in range(1, sum // 2 + 1):
		for j in range(1, n + 1):
			part[i][j] = part[i][j - 1]
			if i >= arr[j - 1]:
				part[i][j] = part[i][j] or part[i - arr[j - 1]][j - 1]
	return part[sum // 2][n]

def bin_sum_array(arr, n):
	for i in range(n):
		if arr[i] % 2 == 1:
			return i + 1
	binarray = [list(reversed(bin(i)[2:])) for i in arr]
	new_array = [0 for i in range(32)]
	for i in binarray:
		for j in range(len(i)):
			if i[j] == '1':
				new_array[j] += 1
	return new_array
nc = 'NO'
yc = 'YES'
ns = 'No'
ys = 'Yes'

def yesno(a):
	print(yc if a else nc)
t = int(input())
for i in range(t):
	n = int(input())
	yesno(issq(n / 2) or issq(n / 4))


for x in range(int(input())):
	n = int(input())
	if (n / 2) ** (1 / 2) == int((n / 2) ** (1 / 2)) or (n / 4) ** (1 / 2) == int((n / 4) ** (1 / 2)):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	if n & 1:
		print('NO')
	else:
		f = 1
		if n % 4 == 0:
			m = n // 4
			s = int(m ** 0.5)
			if s * s == m:
				print('YES')
				continue
		if n % 2 == 0:
			m = n // 2
			s = int(m ** 0.5)
			if s * s == m:
				print('YES')
				continue
		print('NO')


import math
t = int(input())

def get_answer(n):
	if n % 2 == 1:
		return False
	else:
		n = n // 2
		s = math.floor(math.sqrt(n))
		if s ** 2 == n or (s + 1) ** 2 == n:
			return True
		elif n % 2 == 1:
			return False
		else:
			n = n // 2
			s = math.floor(math.sqrt(n))
			if s ** 2 == n or (s + 1) ** 2 == n:
				return True
			else:
				return False
for _ in range(t):
	n = int(input())
	if get_answer(n):
		print('YES')
	else:
		print('NO')


from math import sqrt
for _ in range(int(input())):
	a = int(input())
	w = a // 2
	if a == 1:
		print('NO')
	elif a % 2 != 0:
		print('NO')
	elif sqrt(w) == int(sqrt(w)) or sqrt(a) == int(sqrt(a)):
		print('YES')
	else:
		print('NO')


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	if n & 1:
		print('NO')
		continue
	n = n >> 1
	s = int(n ** 0.5)
	if s * s == n:
		print('YES')
		continue
	if n & 1:
		print('NO')
		continue
	n = n >> 1
	s = int(n ** 0.5)
	if s * s == n:
		print('YES')
		continue
	print('NO')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count

def main():
	for _ in range(int(input())):
		n = int(input())
		f = 0
		if n % 2 == 0:
			t = n // 2
			if int(t ** 0.5) ** 2 == t:
				f = 1
		if n % 4 == 0:
			t = n // 4
			if int(t ** 0.5) ** 2 == t:
				f = 1
		if f:
			print('YES')
		else:
			print('NO')
	return
main()


import math

def EsCuad(x: int) -> bool:
	if math.sqrt(x).is_integer():
		return True
	else:
		return False
t = int(input())
for x in range(t):
	n = int(input())
	n2 = int(n / 2)
	if (EsCuad(n) or EsCuad(n / 2)) and n % 2 == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	if (n / 2) ** 0.5 % 1 == 0 or (n / 4) ** 0.5 % 1 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0 and int((n / 2) ** 0.5) == (n / 2) ** 0.5:
		print('YES')
	elif n % 4 == 0 and int((n / 4) ** 0.5) == (n / 4) ** 0.5:
		print('YES')
	else:
		print('NO')


def issqrt(n):
	s = int(n ** 0.5)
	return s * s == n
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0 and issqrt(n / 2) or (n % 4 == 0 and issqrt(n / 4)):
		print('yes')
	else:
		print('no')


import math
for i in range(int(input())):
	n = int(input())
	y = n
	y = y / 2
	y = math.sqrt(y)
	x = int(y)
	if x == y:
		print('YES')
	else:
		z = n
		z = z / 4
		z = math.sqrt(z)
		m = int(z)
		if m == z:
			print('YES')
		else:
			print('NO')


t = int(input())
f = 0
x = 0
y = 0
for i in range(t):
	n = int(input())
	x = n / 2
	y = n / 4
	f = x ** 0.5
	f = f * int(f)
	m = y ** 0.5
	m = m * int(m)
	if m == y or f == x:
		print('YES')
	else:
		print('NO')


from math import *

def isSquare(x):
	return int(0.5 + sqrt(x)) ** 2 == x

def solve():
	n = int(input())
	if n % 2 == 0 and isSquare(n / 2):
		print('YES')
	elif n % 4 == 0 and isSquare(n / 4):
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	solve()


from math import ceil, sqrt, floor
for _ in range(int(input())):
	n = int(input())
	flag = False
	if n == 1:
		print('NO')
		flag = True
	elif ceil(sqrt(n / 2)) == floor(sqrt(n / 2)) or ceil(sqrt(n / 4)) == floor(sqrt(n / 4)):
		print('YES')
	else:
		print('NO')


from math import sqrt

def main():
	t = int(input())
	while t:
		n = int(input())
		if n % 2 != 0:
			print('NO')
		else:
			v = n / 2
			if sqrt(v) - int(sqrt(v)) == 0 or sqrt(v / 2) - int(sqrt(v / 2)) == 0:
				print('YES')
			else:
				print('NO')
		t -= 1
main()


import math

def main():
	t = int(input())
	for x in range(t):
		n = int(input())
		if math.sqrt(n / 2) % 1 == 0 or math.sqrt(n / 4) % 1 == 0:
			print('YES')
		else:
			print('NO')
main()


import sys
from math import *
import threading
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
sys.setrecursionlimit(300000)
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def npr(n, r):
	return factorial(n) % mod // (factorial(n - r) % mod) if n >= r else 0

def ncr(n, r):
	return factorial(n) % mod // (factorial(r) % mod * (factorial(n - r) % mod)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [{1, i} for i in range(n + 1)]
	p = 2
	while p <= n:
		for i in range(p * 2, n + 1, p):
			prime[i].add(p)
		p += 1
	return prime

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def sumk(a, b):
	print('called for', a, b)
	ans = a * (a + 1) // 2
	ans -= b * (b + 1) // 2
	return ans

def sumi(n):
	ans = 0
	if len(n) > 1:
		for x in n:
			ans += int(x)
		return ans
	else:
		return int(n)
karmanya = int(input())
while karmanya != 0:
	karmanya -= 1
	n = int(input())
	if n == 1:
		print(no)
	else:
		f = 0
		if n % 4 == 0:
			n //= 4
			if sqrt(n) % 1 == 0:
				f = 1
		if n % 2 == 0:
			n //= 2
			if sqrt(n) % 1 == 0:
				f = 1
		print(decision[f])


from itertools import combinations
import sys
import heapq
from collections import defaultdict
import re
import sys
import math
input = sys.stdin.readline
t = int(input())
for i1 in range(t):
	n = int(input())
	i = 1
	twosum = 0
	foursum = 0
	f = 0
	while twosum < n or foursum < n:
		if twosum == n:
			f = 1
			break
		elif foursum == n:
			f = 1
			break
		foursum += i * 4
		twosum += i * 2
		i += 2
	if twosum == n or foursum == n:
		print('YES')
	else:
		print('NO')


from math import sqrt

def get_ans(n):
	if n % 2 != 0:
		return False
	x = n // 2
	x_sqrt = sqrt(x)
	if int(x_sqrt) == x_sqrt:
		return True
	n = x
	if n % 2 == 0:
		x = n // 2
		x_sqrt = sqrt(x)
		if int(x_sqrt) == x_sqrt:
			return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	if get_ans(n):
		print('YES')
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline

def inI():
	inputLine = input().split()
	return int(inputLine[0]) if len(inputLine) == 1 else map(int, inputLine)

def inIL():
	return list(map(int, input().split()))

def inCL():
	return list(input())[:-1]

def out(*liste):
	if isinstance(liste[0], list):
		liste = liste[0]
	for element in liste:
		print(element, end=' ')
	print()
t = inI()
delta = 1e-10
for it in range(t):
	n = inI()
	tri = abs(math.sqrt(n / 2) - round(math.sqrt(n / 2))) < delta or abs(math.sqrt(n / 4) - round(math.sqrt(n / 4))) < delta
	print('YES' if tri else 'NO')


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	m = n
	if n % 2 == 1:
		print('NO')
	else:
		ck = 1
		if sqrt(n // 2).is_integer():
			ck = 0
		if sqrt(n / 4).is_integer():
			ck = 0
		if ck == 0:
			print('YES')
		else:
			print('NO')


import math

def is_square(n):
	root = math.sqrt(n)
	if root % 1 == 0:
		if int(root) * int(root) == n:
			return True
	return False
numOf = int(input())
for i in range(numOf):
	t = int(input())
	numOfTwoPiece = t % 2
	numOfFourPiece = t % 4
	if t % 4 == 0:
		numOfSquare = t / 4
		if is_square(numOfSquare):
			print('YES')
			continue
	if t % 2 == 0:
		numOfSquare = t / 2
		if is_square(numOfSquare):
			print('YES')
			continue
	print('NO')


from math import *
r = []
t = int(input())
for i in range(t):
	a = int(input())
	if log(a, 2) == int(log(a, 2)) and a != 1 or (a % 2 == 0 and sqrt(a // 2) == int(sqrt(a // 2))) or (a % 2 == 0 and sqrt(a) == int(sqrt(a))):
		r.append('YES')
	else:
		r.append('NO')
for i in range(t):
	print(r[i])


def fun(n):
	import math
	if n % 2 == 1:
		return 'NO'
	x = int(math.sqrt(n / 2))
	y = int(math.sqrt(n / 4))
	if x * x == n / 2 or y * y == n / 4:
		return 'YES'
	else:
		return 'NO'
for i in range(int(input())):
	n = int(input())
	ans = fun(n)
	print(ans)


import sys
import math as mt
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	a = mt.isqrt(n // 2)
	b = mt.isqrt(n // 4)
	if a * a * 2 == n or b * b * 4 == n:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 1:
		print('NO')
	else:
		n = n // 2
		if n ** 0.5 == math.floor(n ** 0.5):
			print('YES')
		elif n % 2 != 0:
			print('NO')
		else:
			n = n // 2
			if n ** 0.5 == math.floor(n ** 0.5):
				print('YES')
			else:
				print('NO')


from sys import stdin, stdout
import math

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()

def div2(n):
	if n % 2 != 0:
		return False
	n //= 2
	a = int(math.sqrt(n))
	if a * a == n:
		return True
	return False

def div4(n):
	if n % 4 != 0:
		return False
	n //= 4
	a = int(math.sqrt(n))
	if a * a == n:
		return True
	return False
for _ in range(ii()):
	n = ii()
	if n == 1:
		print('NO')
	elif div2(n) or div4(n):
		print('YES')
	else:
		print('NO')


from math import log2
for test in range(int(input())):
	n = int(input())
	ar = n // 2
	if n % 2:
		print('NO')
		continue
	x = int(ar ** 0.5)
	y = int((ar // 2) ** 0.5)
	if 2 * y ** 2 == ar or x ** 2 == ar:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
i = 1
while True:
	if i > t:
		break
	n = int(input())
	if n % 2 == 0:
		if math.sqrt(n / 2) % 1 == 0 or math.sqrt(n / 4) % 1 == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	i = i + 1


for s in [*open(0)][1:]:
	n = int(s)
	f = 0
	while n & 1 ^ 1:
		n >>= 1
		f = 1
	print('YNEOS'[f * int(n ** 0.5) ** 2 < n::2])


def fun(n):
	h = int(n ** 0.5)
	if n == h ** 2:
		return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		if fun(n // 2):
			print('YES')
		elif fun(n // 4) and n % 4 == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	odd = 0
	i = 1
	while odd < n:
		odd += i * 2
		i += 2
	odd2 = 0
	i = 1
	while odd2 < n:
		odd2 += i * 4
		i += 2
	print('YES' if odd2 == n or odd == n else 'NO')


import sys
import os.path
from collections import *
import math
import bisect
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n % 2:
		print('NO')
	else:
		x = math.log2(n)
		y = math.sqrt(n // 2)
		z = math.sqrt(n)
		if int(x) == x and x != 0 or int(y) == y or int(z) == z:
			print('YES')
		else:
			print('NO')


from sys import *
import math
input = stdin.readline
I = int
R = range
listInput = lambda : list(map(int, input().strip().split()))
lineInput = lambda : map(int, input().strip().split())
sJoin = lambda a, sep: '{}'.format(sep).join(a)
arrJoin = lambda a, sep: '{}'.format(sep).join(map(str, a))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n) + 1), 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def main():
	for _ in R(I(input())):
		(n,) = lineInput()
		div2 = n // 2
		div4 = n // 4
		sqrt = lambda x: int(math.sqrt(x))
		if 2 * sqrt(div2) ** 2 == n or 4 * sqrt(div4) ** 2 == n:
			print('YES')
		else:
			print('NO')
main()


for s in [*open(0)][1:]:
	n = int(s)
	if n % 2 == 0:
		n //= 2
		i = int(n ** 0.5)
		if i * i == n:
			print('YES')
			continue
		elif n % 2 == 0:
			n //= 2
			i = int(n ** 0.5)
			if i * i == n:
				print('YES')
				continue
	print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	if not n % 2:
		if (n // 2) ** 0.5 == int((n // 2) ** 0.5):
			print('YES')
			continue
		if not n % 4:
			if (n // 4) ** 0.5 == int((n // 4) ** 0.5):
				print('YES')
				continue
			print('NO')
		else:
			print('NO')
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0 and math.sqrt(n) == math.ceil(math.sqrt(n)):
		print('YES')
		continue
	if n % 2 == 0 and math.sqrt(n // 2) == math.ceil(math.sqrt(n // 2)):
		print('YES')
		continue
	print('NO')


import math
t = int(input())
for i in range(t):
	n = int(input())
	z = n / 2
	y = n / 4
	if y ** 0.5 - int(y ** 0.5) == 0:
		print('YES')
	elif z ** 0.5 - int(z ** 0.5) == 0:
		print('YES')
	else:
		print('NO')


def main(n):
	if not n % 2:
		if ((n // 2) ** (1 / 2)).is_integer() or (not n // 2 % 2 and ((n // 4) ** (1 / 2)).is_integer()):
			return 'YES'
		else:
			return 'NO'
	else:
		return 'NO'
t = int(input())
for _ in range(t):
	n = int(input())
	print(main(n))


import math

def square(a):
	b = int(math.sqrt(a))
	return b * b == a
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0 and square(n // 2):
		print('YES')
	elif n % 4 == 0 and square(n // 4):
		print('YES')
	else:
		print('NO')


import math
import sys
n_cases = int(sys.stdin.readline().strip())
for _ in range(n_cases):
	n = int(sys.stdin.readline().strip())
	cond = n in (2 * int(math.sqrt(n // 2)) ** 2, 4 * int(math.sqrt(n // 4)) ** 2)
	print('YES' if cond else 'NO')


from io import BytesIO, IOBase
from math import sqrt
import sys, os
from os import path
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def B(n):
	return bin(n).replace('0b', '')

def factors(n):
	arr = []
	for i in ra(2, int(sqrt(n)) + 1):
		if n % i == 0:
			arr.append(i)
			if i * i != n:
				arr.append(int(n / i))
	return arr

def dfs(arr, n):
	pairs = [[i + 1] for i in ra(n)]
	vis = [0] * (n + 1)
	for i in ra(l(arr)):
		pairs[arr[i][0] - 1].append(arr[i][1])
	pairs[arr[i][1] - 1].append(arr[i][0])
	comp = []
	for i in ra(n):
		stack = [pairs[i]]
		temp = []
		if vis[stack[-1][0]] == 0:
			while len(stack) > 0:
				if vis[stack[-1][0]] == 0:
					temp.append(stack[-1][0])
					vis[stack[-1][0]] = 1
					s = stack.pop()
					for j in s[1:]:
						if vis[j] == 0:
							stack.append(pairs[j - 1])
				else:
					stack.pop()
			comp.append(temp)
	return comp
from bisect import bisect_left as bl
from bisect import bisect_right as br
import sys, operator, math, operator
from collections import Counter
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import random
tc = inpi()
while tc:
	tc -= 1
	n = inpi()
	if n & 1:
		P('NO')
	else:
		n = n / 2
		sq = int(math.sqrt(n))
		if sq * sq == n:
			P('YES')
		else:
			n = n / 2
			sq = int(math.sqrt(n))
			if sq * sq == n:
				P('YES')
			else:
				P('NO')


import math
testcase = int(input())
can = [False] * testcase
for i in range(testcase):
	number = int(input())
	if int(math.sqrt(number / 2)) ** 2 == number / 2 or int(math.sqrt(float(number) / 4)) ** 2 == number / 4:
		can[i] = True
for i in can:
	if i:
		print('YES')
	else:
		print('NO')


import math

def isPerfectSquare(x):
	if x >= 0:
		sr = int(math.sqrt(x))
		return sr * sr == x
	return false
for z in range(int(input())):
	n = int(input())
	if n % 2 == 0 and isPerfectSquare(n // 2) or (n % 4 == 0 and isPerfectSquare(n // 4)):
		print('YES')
	else:
		print('NO')


cases = int(input())
mapping = set()
for i in range(1, 32):
	mapping.add(2 ** i)
double = sorted(mapping, reverse=True)
while cases:
	cases -= 1
	num = int(input())
	if num in mapping:
		print('YES')
	else:
		found = False
		for n in double:
			if num % n == 0:
				found = True
				num //= n
				if num ** 0.5 == int(num ** 0.5):
					print('YES')
				else:
					print('NO')
		if not found:
			print('NO')


import math

def check(tmp):
	return math.ceil(tmp) == math.floor(tmp)

def Log2(x):
	if x == 0:
		return False
	return math.log10(x) / math.log10(2)
for _ in range(int(input())):
	a = int(input())
	if a % 2 != 0:
		print('NO')
		continue
	if check(Log2(a)):
		print('YES')
		continue
	if check(math.sqrt(a / 2)):
		print('YES')
		continue
	if check(math.sqrt(a / 4)):
		print('YES')
		continue
	else:
		print('NO')


import sys
import math
from math import factorial, inf, gcd, sqrt
from heapq import *
from functools import *
from itertools import *
from collections import *
from typing import *
from bisect import *
import random
sys.setrecursionlimit(10 ** 5)

def rarray():
	return [int(i) for i in input().split()]
t = 1
t = int(input())
for ii in range(t):
	n = int(input())
	if n % 2 == 1:
		print('NO')
		continue
	while n % 2 == 0:
		n //= 2
	t = int(sqrt(n))
	print('YES' if t * t == n else 'NO')


from math import floor, sqrt
from sys import stdin

def read_int():
	return int(stdin.readline())

def is_square(x):
	s = int(floor(sqrt(x)))
	return s * s == x
t = read_int()
for case_num in range(t):
	n = read_int()
	print('YES' if n % 2 == 0 and is_square(n // 2) or (n % 4 == 0 and is_square(n // 4)) else 'NO')


import math

def is_perfect_sqr(n):
	s = int(math.sqrt(n))
	return s * s == n
t = int(input())
for x in range(t):
	n = int(input())
	if n % 2 != 0 and n % 4 != 0:
		print('NO')
		continue
	if is_perfect_sqr(int(n / 2)):
		print('YES')
		continue
	if n % 4 == 0 and is_perfect_sqr(int(n / 4)):
		print('YES')
		continue
	print('NO')


import bisect
import collections
import functools
import heapq
import itertools
import math
import random
import sys
input = sys.stdin.readline
ri = lambda : int(input())
rf = lambda : list(map(float, input().split()))
rl = lambda : list(map(int, input().split()))
rs = lambda : input().rstrip()
MOD = 10 ** 9 + 7
INF = float('inf')

def solve_case():

	def is_square(x):
		return x == int(x ** 0.5) ** 2
	n = ri()
	if n % 2 == 0 and is_square(n // 2) or (n % 4 == 0 and is_square(n // 4)):
		print('YES')
	else:
		print('NO')
T = ri()
for ti in range(1, T + 1):
	solve_case()


import math
t = int(input())
for i in range(t):
	res = 'NO'
	n = int(input())
	if n % 2 == 0 and math.sqrt(n // 2) == int(math.sqrt(n // 2)):
		res = 'YES'
	if n % 4 == 0 and math.sqrt(n // 4) == int(math.sqrt(n // 4)):
		res = 'YES'
	print(res)


import os
from io import BytesIO, IOBase
import sys
import math

def main():
	for j in range(int(input())):
		n = int(input())
		if n % 2 != 0:
			print('NO')
		else:
			c = 0
			if int(math.sqrt(n // 2)) ** 2 == n // 2:
				c = c + 1
			elif n % 4 == 0 and int(math.sqrt(n // 4)) ** 2 == n // 4:
				c = c + 1
			if c == 0:
				print('NO')
			else:
				print('YES')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math

def isSquare(num):
	sr = int(math.sqrt(num))
	return sr * sr == num

def solve(s):
	if (s % 2 == 0 and isSquare(s / 2) or math.sqrt(s) % 2 == 0) and s != 1:
		print('YES')
	else:
		print('NO')
tcs = int(input())
for i in range(tcs):
	s = int(input())
	solve(s)


def per_sq(n):
	sq = int(pow(n, 0.5))
	if sq * sq == n:
		return 1
	return 0
for i in range(int(input())):
	n = int(input())
	if n % 2 == 1:
		print('NO')
	elif per_sq(n) == 1:
		print('YES')
	else:
		n //= 2
		if per_sq(n) == 1:
			print('YES')
		else:
			print('NO')


import sys

def solve(k):
	if k % 2:
		return 'NO'
	k //= 2
	side = int(k ** 0.5)
	if side * side == k or (side + 1) * (side + 1) == k or (side - 1) * (side - 1) == k:
		return 'YES'
	if k % 2:
		return 'NO'
	k //= 2
	side = int(k ** 0.5)
	if side * side == k or (side + 1) * (side + 1) == k or (side - 1) * (side - 1) == k:
		return 'YES'
	return 'NO'

def main():
	res = ''
	input = sys.stdin.readline
	print = sys.stdout.write
	t = int(input())
	for _ in range(t):
		n = int(input())
		res += str(solve(n)) + '\n'
	print(res)
main()


import math

def check(n):
	i = int(math.sqrt(n))
	return i * i == n
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0 and (check(n) or check(n / 2)):
		print('YES')
	else:
		print('NO')


from math import log
from math import floor
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0 and ((n / 2) ** 0.5).is_integer() or (n % 4 == 0 and ((n / 4) ** 0.5).is_integer()):
		print('YES')
	else:
		print('NO')


import math
t = int(input())
while t:
	t -= 1
	a = int(input())
	s = a / 2
	if int(math.sqrt(s)) ** 2 == s:
		print('YES')
	elif s % 2 == 0 and int(math.sqrt(s / 2)) ** 2 == s / 2:
		print('YES')
	else:
		print('NO')


num_inp = lambda : int(input())
arr_inp = lambda : list(map(int, input().split()))
sp_inp = lambda : map(int, input().split())
str_inp = lambda : input()
for s in [*open(0)][1:]:
	n = int(s)
	f = 0
	while n & 1 ^ 1:
		n >>= 1
		f = 1
	print('YNEOS'[f * int(n ** 0.5) ** 2 < n::2])


t = int(input())
ns = []
for i in range(0, t):
	ns.append(int(input()))
for n in ns:
	if ((n / 2) ** (1 / 2)).is_integer():
		print('YES')
	elif ((n / 4) ** (1 / 2)).is_integer():
		print('YES')
	else:
		print('NO')


for v in range(int(input())):
	var = False
	n = int(input())
	if n % 2 == 0:
		a = int(n / 2)
		if a ** 0.5 == int(a ** 0.5):
			var = True
	if n % 4 == 0:
		a = int(n / 4)
		if a ** 0.5 == int(a ** 0.5):
			var = True
	if var == True:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for ti in range(t):
	n = int(input())
	if n % 2 == 1:
		print('NO')
		continue
	if n == 2 or n == 4:
		print('YES')
		continue
	if n > 4 and (int(math.sqrt(n)) ** 2 == n or int(math.sqrt(n // 2)) ** 2 == n // 2):
		print('YES')
	else:
		print('NO')


t = int(input())
for q in range(t):
	n = int(input())
	a = (n / 2) ** 0.5
	b = (n / 4) ** 0.5
	if a % 1 == 0 or b % 1 == 0:
		print('YES')
	else:
		print('NO')


import math

def isPerfectSquare(x):
	if math.ceil(x) != math.floor(x):
		return False
	if x >= 0:
		sr = int(math.sqrt(x))
		return sr * sr == x
	return False
for t in range(int(input())):
	n = int(input())
	if isPerfectSquare(n / 2) or isPerfectSquare(n / 4):
		print('YES')
	else:
		print('NO')


import math

def isSqure(n):
	x = math.sqrt(n)
	x = round(x)
	return x * x == n
t = int(input())
for i in range(t):
	n = int(input())
	if n & 1:
		print('NO')
		continue
	n >>= 1
	if isSqure(n):
		print('YES')
		continue
	if n & 1:
		print('NO')
		continue
	n >>= 1
	if isSqure(n):
		print('YES')
		continue
	print('NO')


import math
t = int(input())
for i in range(t):
	n = int(input())
	x = n / 2
	y = n / 4
	if math.sqrt(x) == int(math.sqrt(x)) or math.sqrt(y) == int(math.sqrt(y)):
		print('YES')
	else:
		print('NO')


import math
inputs = []
while True:
	try:
		line = input()
	except EOFError:
		break
	inputs.append(line)

def Log2(x):
	return math.log10(x) / math.log10(2)

def Pof2(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def is_perfect_square(number: int) -> bool:
	return int(math.sqrt(number) + 0.5) ** 2 == number
t = int(inputs[0])
for i in range(1, t + 1):
	if int(inputs[i]) % 2 == 0:
		if int(inputs[i]) == 2:
			print('YES')
		elif Pof2(int(inputs[i])):
			print('YES')
		elif is_perfect_square(int(int(inputs[i]) / 2)):
			print('YES')
		elif is_perfect_square(int(inputs[i])):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect, insort
from time import perf_counter
from fractions import Fraction
import copy
from copy import deepcopy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
for _ in range(L()[0]):
	n = L()[0]
	x = int((n // 2) ** 0.5)
	y = int((n // 4) ** 0.5)
	if n % 2 == 0 and x * x == n // 2 or (n % 4 == 0 and y * y == n // 4):
		print('YES')
	else:
		print('NO')
endtime = time.time()


import sys
import math
n = int(sys.stdin.readline())
for i in range(n):
	noOfTr = int(sys.stdin.readline())
	possibility = 'NO'
	if noOfTr % 2 == 1:
		possibility = 'No'
	elif math.ceil(math.sqrt(noOfTr // 2)) == math.sqrt(noOfTr // 2):
		possibility = 'YES'
	elif math.ceil(math.sqrt(noOfTr)) == math.sqrt(noOfTr):
		possibility = 'YES'
	print(possibility)


import math
r = []
for x in range(int(input())):
	n = int(input())
	if math.sqrt(n / 2) % 1 == 0 or math.sqrt(n / 4) % 1 == 0:
		r.append('YES')
	else:
		r.append('NO')
for x in r:
	print(x)


import math

def isPerfectSquare(n):
	sqrt = math.ceil(math.sqrt(n // 2))
	if sqrt ** 2 * 2 == n:
		return True
	return False
t = int(input())
result = []
for i in range(t):
	n = int(input())
	if n % 2 != 0:
		result.append('NO')
	elif isPerfectSquare(n) | isPerfectSquare(n // 2):
		result.append('YES')
	else:
		result.append('NO')
for i in result:
	print(i)


for s in [*open(0)][1:]:
	n = int(s)
	b = bin(n)
	k = len(b) - len(b.rstrip('0'))
	n //= 2 ** k
	print('YNEOS'[k < 1 or int(n ** 0.5) ** 2 < n::2])


from queue import PriorityQueue
import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0 and int((n // 2) ** 0.5) == (n // 2) ** 0.5 or (n % 4 == 0 and int((n // 4) ** 0.5) == (n // 4) ** 0.5):
		print('YES')
	else:
		print('NO')


from io import BytesIO, IOBase
import sys
import math
import os
from collections import defaultdict
from math import ceil
from bisect import bisect_left, bisect_left
from time import perf_counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def mint():
	return map(int, input().split())

def mfloat():
	return map(float, input().split())

def sq(n):
	return int(math.sqrt(n)) ** 2 == n

def solve():
	n = int(input())
	if n % 4 == 0:
		large = n // 4
		if sq(large):
			print('YES')
			return
	if n % 2 == 0:
		small = n // 2
		if sq(small):
			print('YES')
			return
	print('NO')

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


from math import sqrt
I = input

def issquare(n):
	sq = sqrt(n)
	return sq == int(sq)
for _ in range(int(I())):
	n = int(I())
	if n % 2 == 0 and issquare(n // 2) or (n % 4 == 0 and issquare(n // 4)):
		print('YES')
	else:
		print('NO')


def ps(n):
	x = int(n ** 0.5)
	if x * x == n:
		return True
	else:
		return False
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 1:
		print('NO')
	else:
		while n % 2 == 0:
			n //= 2
		if ps(n):
			print('YES')
		else:
			print('NO')


for t in range(int(input())):
	x = int(input())
	if (x / 2) ** 0.5 == float(int((x // 2) ** 0.5)) or (x / 4) ** 0.5 == float(int((x / 4) ** 0.5)):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	if n % 2:
		print('NO')
		continue
	n = n / 2
	if int(n ** 0.5) == n ** 0.5:
		print('YES')
	elif n % 2 == 0:
		n = n / 2
		if int(n ** 0.5) == n ** 0.5:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from math import sqrt
for i in range(int(input())):
	a = int(input())
	if a % 2 == 0 and int(sqrt(a // 2)) ** 2 == a / 2:
		print('YES')
	elif a % 4 == 0 and int(sqrt(a // 4)) ** 2 == a // 4:
		print('YES')
	else:
		print('NO')


def factorization(n):
	dic = {}
	d = 2
	while d * d <= n:
		while n % d == 0:
			dic[d] = dic.get(d, 0) + 1
			n //= d
		d += 1
	if n > 1:
		dic[n] = dic.get(d, 0) + 1
	return dic
t = int(input())
for _ in range(t):
	n = int(input())
	ans = True
	if n % 2 == 1:
		ans = False
		print('NO')
		continue
	d = factorization(n)
	for key in d:
		if key != 2 and d[key] % 2 == 1:
			ans = False
	if ans:
		print('YES')
	else:
		print('NO')


def sq(y):
	if y ** 0.5 - int(y ** 0.5) == 0 and y != 0:
		return 1
	else:
		return 0
t = int(input())
for i in range(t):
	x = int(input())
	if x % 2 == 0 and sq(x // 2) == 1 or (x % 4 == 0 and sq(x // 4) == 1):
		print('YES')
	else:
		print('NO')


d = {}
for i in range(1, 10 ** 5):
	p1 = i * i * 2
	p2 = i * i * 4
	d[p1] = 0
	d[p2] = 0

def solution():
	n = int(input())
	if n in d:
		print('YES')
	else:
		print('NO')
for tc in range(int(input())):
	solution()


def main():
	for t in range(int(input())):
		n = int(input())
		if n / 2 % (n / 2) ** 0.5 == 0 or n / 4 % (n / 4) ** 0.5 == 0:
			print('YES')
		else:
			print('NO')
main()


def read_ints():
	return map(int, input().split())

def floor_sqrt(x):
	assert x >= 0
	if x == 0:
		return 0
	assert x >= 1
	min_sqrt = 1
	max_sqrt = x
	while min_sqrt != max_sqrt:
		mid_sqrt = (min_sqrt + max_sqrt + 1) // 2
		if mid_sqrt ** 2 <= x:
			min_sqrt = mid_sqrt
		else:
			max_sqrt = mid_sqrt - 1
	return min_sqrt

def is_square(x):
	return x == floor_sqrt(x) ** 2

def can_build_square(pieces_n):
	can_build_using_small_blocks = pieces_n % 2 == 0 and is_square(pieces_n // 2)
	can_build_using_large_blocks = pieces_n % 4 == 0 and is_square(pieces_n // 4)
	return can_build_using_small_blocks or can_build_using_large_blocks
(t_n,) = read_ints()
for i_t in range(t_n):
	(n,) = read_ints()
	if can_build_square(n):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	a = int(input())
	if a % 2 == 1:
		print('NO')
	elif int((a // 2) ** 0.5 + 0.05) ** 2 == a // 2:
		print('YES')
	elif a % 4 == 0 and int((a // 4) ** 0.5 + 0.05) ** 2 == a // 4:
		print('YES')
	else:
		print('NO')


from math import sqrt
list1 = []
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0 and sqrt(n // 2).is_integer():
		list1.append('YES')
	elif n % 4 == 0 and sqrt(n // 4).is_integer():
		list1.append('YES')
	else:
		list1.append('NO')
print(*list1, sep='\n')


import math
from sys import stdin

def A():
	t = stdin.readline()
	t = int(t)
	while t:
		t -= 1
		a = [int(x) for x in stdin.readline().split()]
		(n, x) = (a[0], a[1])
		w = [int(x) for x in stdin.readline().split()]
		w.sort()
		res = 0
		res_b = True
		for i in range(0, n):
			res += w[i]
			if res == x:
				l = i
				while res == x:
					if l >= n:
						res_b = False
						break
					res -= w[l]
					l += 1
					if l >= n:
						res_b = False
						break
					res += w[l]
				if l >= n:
					res_b = False
					break
				(w[i], w[l]) = (w[l], w[i])
		if res_b:
			print('YES')
			for i in w:
				print(i, end=' ')
			print()
		else:
			print('NO')

def sq(c):
	d = int(math.sqrt(c))
	if d * d == c:
		return 1
	return 0

def B():
	t = stdin.readline()
	t = int(t)
	while t:
		t -= 1
		b = int(stdin.readline())
		res = True
		if b % 2 == 0 and sq(b / 2) or (b % 4 == 0 and sq(b / 4)):
			print('YES')
		else:
			print('NO')
B()


from math import sqrt
g = int(input())
f = [None for i in range(g)]
for i in range(g):
	n = int(input())
	a = sqrt(n / 2)
	b = sqrt(n / 4)
	if a == int(a) or b == int(b) or (a == int(a) and b == int(b)):
		f[i] = 'YES'
	else:
		f[i] = 'NO'
for i in range(g):
	print(f[i])


for _ in range(int(input())):
	n = int(input())
	a = (n / 2) ** 0.5
	b = (n / 4) ** 0.5
	print('NYOE S'[a == int(a) or b == int(b)::2])


import math
t = int(input())
while t > 0:
	n = int(input())
	a = (n / 2) ** 0.5
	b = (n / 4) ** 0.5
	print(('NO', 'YES')[a % 1 == 0 or b % 1 == 0])
	t -= 1


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import math

def isq(x):
	s = int(math.sqrt(x))
	return s * s == x
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 != 0:
		print('NO')
		continue
	x = n // 2
	if isq(x):
		print('YES')
		continue
	if n % 4 == 0 and isq(n // 4):
		print('YES')
		continue
	print('NO')


import sys
import math
input = sys.stdin.readline
t = int(input())
for test in range(t):
	n = int(input())
	if math.sqrt(n / 2).is_integer():
		print('YES')
	elif math.sqrt(n / 4).is_integer():
		print('YES')
	else:
		print('NO')


def is_square(x):
	return x ** 0.5 % 1 == 0

def solve(n):
	if n % 2 == 0 and is_square(n / 2):
		return 'YES'
	elif n % 4 == 0 and is_square(n / 4):
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	print(solve(int(input())))


import os
import sys
import math
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def dijkstra(start, distance, path, n):
	visited = [False for _ in range(n)]
	distance[start] = 0
	for i in range(n):
		v = -1
		for j in range(n):
			if not visited[v] and (v == -1 or distance[j] < distance[v]):
				v = j
		if distance[v] == math.inf:
			break
		visited[v] = True
		for edge in adj[v]:
			destination = edge[0]
			weight = edge[1]
			if distance[v] + weight < distance[destination]:
				distance[destination] = distance[v] + weight
				path[destination] = v

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def seive(n):
	primes = [True] * (n + 1)
	ans = []
	for i in range(2, n):
		if not primes[i]:
			continue
		j = 2 * i
		while j <= n:
			primes[j] = False
			j += i
	for p in range(2, n + 1):
		if primes[p]:
			ans += [p]
	return ans

def factors(n):
	factors = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			if n // x == x:
				factors.append(x)
			else:
				factors.append(x)
				factors.append(n // x)
		x += 1
	return factors

def main():
	try:
		for _ in range(inp()):
			n = inp()
			if n % 2 == 0 and math.sqrt(n // 2).is_integer():
				print('YES')
			elif n % 4 == 0 and math.sqrt(n // 4).is_integer():
				print('YES')
			else:
				print('NO')
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for i in range(int(input())):
	n = int(input())
	if ((n / 2) ** 0.5).is_integer() or ((n / 4) ** 0.5).is_integer():
		print('YES')
	else:
		print('NO')


t = int(input())

def sq(n):
	return n ** 0.5 == int(n ** 0.5)
for _ in range(t):
	n = int(input())
	if sq(n / 4) or sq(n / 2):
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 4 == 0 and int(math.sqrt(n / 4) + 0.5) ** 2 == n / 4:
		print('YES')
		continue
	if n % 2 == 0 and int(math.sqrt(n / 2) + 0.5) ** 2 == n / 2:
		print('YES')
		continue
	print('NO')


from sys import stdin, stdout, maxsize
from math import sqrt, log, factorial as ft, gcd, ceil
from collections import defaultdict as D
from bisect import insort
for _ in range(1, int(input()) + 1):
	n = int(input())
	if n % 2 == 0:
		if sqrt(n // 2) == int(sqrt(n // 2)):
			print('YES')
		elif n % 4 == 0:
			if sqrt(n // 4) == int(sqrt(n // 4)):
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
	else:
		print('NO')


from sys import stdin, stdout
nmbr = lambda : int(input())
lst = lambda : list(map(int, input().split()))

def per(x):
	if x == 0:
		return 0
	sq = 1
	while sq * sq < x:
		sq += 1
	return sq * sq == x
for _ in range(nmbr()):
	n = nmbr()
	f = 0
	for k in [2, 4, 8]:
		if n % k != 0:
			continue
		sq = n // k
		if per(sq):
			f = 1
			break
	print('YES' if f else 'NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print('YES')
		continue
	f = True
	if n % 2:
		print('NO')
	else:
		n //= 2
		if True:
			if n ** 0.5 == int(n ** 0.5):
				print('YES')
			else:
				if n % 2:
					print('NO')
					continue
				n //= 2
				if n ** 0.5 == int(n ** 0.5):
					print('YES')
				else:
					print('NO')


import sys
from bisect import *
from collections import deque
from copy import *
from itertools import permutations as prm, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def dadd(d, p, val):
	if p in d:
		d[p].append(val)
	else:
		d[p] = [val]

def gi():
	return [xx for xx in input().split()]

def gtc(tc, *ans):
	print('Case #' + str(tc) + ':', *ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def bits(i, n):
	p = bin(i)[2:]
	return (n - len(p)) * '0' + p

def prec(a, pre):
	for i in a:
		pre.append(pre[-1] + i)
	pre.pop(0)

def YN(flag):
	print('YES' if flag else 'NO')

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
INF = 10 ** 18
uu = t
mod = 10 ** 9 + 7
d = {}
i = 1
while i * i < 10 ** 10:
	d[i * i * 2] = 1
	d[i * i * 4] = 1
	i += 1
while t > 0:
	t -= 1
	n = fi()
	YN(n in d)


def nn(n):
	kol2 = 0
	kol3 = 0
	while n % 2 == 0:
		kol2 += 1
		n = int(n / 2)
	while n % 3 == 0:
		kol3 += 1
		n = int(n / 3)
	if int(pow(n, 0.5)) ** 2 == n:
		n = 1
	if n == 1 and kol3 % 2 == 0 and (kol2 > 0):
		print('YES')
	else:
		print('NO')
t = int(input())
a = []
b = []
while t > 0:
	t -= 1
	n = int(input())
	nn(n)


import math

def isSquare(x):
	if x >= 0:
		sr = math.sqrt(x)
		s = math.floor(sr)
		return s * s == x
	return False
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		if isSquare(n // 2):
			print('YES')
		elif n % 4 == 0 and isSquare(n // 4):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 != 0:
		print('NO')
		continue
	n1 = n / 2
	n2 = n / 4
	x = int(n1 ** 0.5)
	x1 = int(n2 ** 0.5)
	flag = False
	if x * x == n1 or x1 * x1 == n2:
		flag = True
	if flag:
		print('YES')
	else:
		print('NO')


import math

def is_square(n):
	y = int(math.sqrt(n))
	return y * y == n

def its_possible(n):
	if not n % 2 and is_square(n // 2):
		return 'YES'
	if not n % 4 and is_square(n // 4):
		return 'YES'
	return 'NO'

def main():
	for i in range(int(input())):
		print(its_possible(int(input())))
main()


import random
import math
from collections import defaultdict
import itertools
from sys import stdin, stdout

def main():
	z = ''
	for _ in range(int(stdin.readline())):
		n = int(stdin.readline())
		if n % 2 == 1:
			print('NO')
		else:
			n = n // 2
			x = n
			if x % 2 == 0:
				x = x // 2
				r = int(math.sqrt(x))
				if x == r * r:
					print('YES')
				else:
					x = x * 2
					r = int(math.sqrt(x))
					if x == r * r:
						print('YES')
					else:
						print('NO')
			else:
				r = int(math.sqrt(x))
				if x == r * r:
					print('YES')
				else:
					print('NO')
main()


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
sq = set()
for i in range(1, 10 ** 5):
	sq.add(i * i)
n = int(input())
for _ in range(n):
	x = int(input())
	if x % 2 == 0 and x // 2 in sq:
		print('YES')
	elif x % 4 == 0 and x // 4 in sq:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = 2
	tempa = a
	ak = 1
	b = 4
	tempb = b
	bk = 1
	while a < n:
		a += ak * tempa + ak * tempa + tempa
		ak += 1
	while b < n:
		b += bk * tempb + bk * tempb + tempb
		bk += 1
	if a == n or b == n:
		print('YES')
	else:
		print('NO')


from math import log2 as log
for _ in range(int(input())):
	n = int(input())
	if n & 1:
		print('NO')
	else:
		f = 0
		i = 1
		while i * i <= n:
			if i * i == n:
				f = 1
			i += 1
		i = 1
		while i * i <= 2 * n:
			if i * i == 2 * n:
				f = 1
			i += 1
		print('YES' if f else 'NO')


from math import floor, ceil

def check1(n):
	l = n // 2
	l = l ** 0.5
	if ceil(l) == floor(l):
		return True
	return False

def check2(n):
	if n % 4 != 0:
		return False
	l = n // 4
	l = l ** 0.5
	if ceil(l) == floor(l):
		return True
	return False
for _ in range(int(input())):
	n = int(input())
	if n % 2 != 0:
		print('NO')
		continue
	if check1(n):
		print('YES')
		continue
	if check2(n):
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	N = int(input())
	if N % 2 == 1:
		print('NO')
	else:
		N //= 2
		if N ** (1 / 2) == int(N ** (1 / 2)):
			print('YES')
		elif N % 2 == 1:
			print('NO')
		else:
			N //= 2
			if N ** (1 / 2) == int(N ** (1 / 2)):
				print('YES')
			else:
				print('NO')


import heapq
import math
tcs = int(input())
for tc in range(tcs):
	N = int(input())
	res = False
	if N >= 2:
		if N == N // 2 * 2:
			if int(math.sqrt(N // 2)) * int(math.sqrt(N // 2)) == N // 2:
				res = True
			if N == N // 4 * 4:
				if int(math.sqrt(N // 4)) * int(math.sqrt(N // 4)) == N // 4:
					res = True
	if res:
		print('YES')
	else:
		print('NO')


import math

def issqr(x):
	root = int(math.sqrt(x))
	return root * root == x
for i in range(int(input())):
	n = int(input())
	print('YES' if n % 4 == 0 and issqr(n // 4) or (n % 2 == 0 and issqr(n // 2)) else 'NO')


from math import sqrt
t = int(input())
for _ in range(t):
	n = int(input())
	if n in (1,):
		print('NO')
		continue
	if n in (2, 4):
		print('YES')
		continue
	if not n % 2:
		a = n // 2
		if sqrt(a).is_integer():
			print('YES')
		elif not a % 2 and sqrt(a // 2).is_integer():
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import sys
import math
mod = 10 ** 9 + 7
LI = lambda : [int(k) for k in input().split()]
input = lambda : sys.stdin.readline().rstrip()
IN = lambda : int(input())
S = lambda : input()
for t in range(IN()):
	n = IN()
	if math.sqrt(n / 2) % 1 == 0 or math.sqrt(n / 4) % 1 == 0:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	v = int(input())
	if math.sqrt(v / 2) % 1 == 0 or math.sqrt(v / 4) % 1 == 0:
		print('YES')
	else:
		print('NO')


import math

def is_square(n):
	return int(math.sqrt(n)) ** 2 == n
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('NO')
	elif n % 2 == 0 and is_square(n // 2) or (n % 4 == 0 and is_square(n // 4)):
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = int(math.sqrt(n / 2))
	b = int(math.sqrt(n / 4))
	if 2 * a ** 2 == n or 4 * b ** 2 == n:
		print('YES')
	else:
		print('NO')


import math

def is_perfect_square(num):
	num = int(num)
	root = math.sqrt(num)
	return int(root + 0.5) ** 2 == num
n = int(input())
for _ in range(n):
	num = int(input())
	sol = num % 2 == 0 and is_perfect_square(num / 2) or (num % 4 == 0 and is_perfect_square(num / 4))
	print('YES' if sol else 'NO')


arr = []
arr2 = []
val = 1
ans = []
from math import sqrt, floor
for i in range(30, -1, -1):
	val *= 2
	arr.append(val)
arr.reverse()
for _ in range(int(input())):
	n = int(input())
	flag = 0
	for i in arr:
		if n % i == 0:
			flag = 1
			n //= i
	s = floor(sqrt(n))
	if s * s == n and flag == 1:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
from math import sqrt
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	if n % 2 == 0 and int(sqrt(n // 2) + 0.5) ** 2 == n // 2 or (n % 4 == 0 and int(sqrt(n // 4) + 0.5) ** 2 == n // 4):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	flag = False
	if n % 4 == 0:
		temp = n // 4
		i = 1
		while i ** 2 <= temp:
			if i ** 2 == temp:
				flag = True
				break
			i += 1
	if n % 2 == 0:
		temp = n // 2
		i = 1
		while i ** 2 <= temp:
			if i ** 2 == temp:
				flag = True
				break
			i += 1
	if flag:
		print('YES')
	else:
		print('NO')


from math import *
for _ in range(int(input())):
	n = int(input())
	if int(sqrt(n / 2)) == sqrt(n / 2) or int(sqrt(n / 4)) == sqrt(n / 4):
		print('YES')
	else:
		print('NO')


def square(n):
	x = n ** 0.5
	x1 = int(x)
	if x1 * x1 == n:
		return 1
	else:
		return 0
for i in range(0, int(input())):
	n = int(input())
	if square(n / 2) == 1 or square(n / 4) == 1:
		print('YES')
	else:
		print('NO')


from math import *
R = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n,) = R()
	ans = 'NO'
	if n & 1 == 0:
		if sqrt(n / 2) == round(sqrt(n / 2)):
			ans = 'YES'
		elif n % 4 == 0:
			if sqrt(n / 4) == round(sqrt(n / 4)):
				ans = 'YES'
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0 and n // 2 == round((n // 2) ** 0.5, 2) ** 2:
		print('YES')
	elif n % 4 == 0 and n // 4 == round((n // 4) ** 0.5, 2) ** 2:
		print('YES')
	else:
		print('NO')


t = int(input())
import math
for j in range(1, t + 1):
	n = int(input())
	if n % 2 != 0:
		print('NO')
	elif n % 2 == 0:
		n = n // 2
		if math.sqrt(n) % 1 == 0:
			print('YES')
		elif n % 2 == 0:
			n = n // 2
			if math.sqrt(n) % 1 == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
	else:
		print('NO')


import sys, math
input = sys.stdin.readline
out = []
t = int(input())
for _ in range(t):
	n = int(input())
	o1 = math.isqrt(n // 2)
	o2 = math.isqrt(n // 4)
	if 2 * o1 * o1 == n or 4 * o2 * o2 == n:
		out.append('YES')
	else:
		out.append('NO')
print('\n'.join(out))


from math import sqrt
t = int(input())

def check(n):
	if int(sqrt(n)) ** 2 == n:
		return True
	return False
for _ in range(t):
	n = int(input())
	if n % 2 == 1:
		print('NO')
		continue
	if check(n // 2):
		print('YES')
		continue
	elif n % 4 == 0 and check(n // 4):
		print('YES')
		continue
	print('NO')


from sys import stdin, stdout
from math import *

def is_sqr(x):
	s = trunc(sqrt(x))
	return s ** 2 == x

def main():
	ntest = int(stdin.readline())
	for i in range(ntest):
		n = int(stdin.readline())
		if is_sqr(n // 2) and n % 2 == 0 or (is_sqr(n // 4) and n % 4 == 0):
			stdout.write('YES\n')
		else:
			stdout.write('NO\n')
	return 0
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 1:
		print('NO')
		continue
	n //= 2
	(l, r) = (0, n + 2)
	while r - l > 1:
		m = (l + r) // 2
		if m * m <= n:
			l = m
		else:
			r = m
	if l * l == n:
		print('YES')
		continue
	(l, r) = (0, n + 2)
	while r - l > 1:
		m = (l + r) // 2
		if m * m * 2 <= n:
			l = m
		else:
			r = m
	if l * l * 2 == n:
		print('YES')
		continue
	print('NO')


import math

def square(n):
	if int(math.sqrt(n) + 0.5) ** 2 == n:
		return True
	else:
		return False
for _ in range(int(input())):
	n = int(input())
	ans = 0
	if n % 2 == 0 and ans == 0:
		temp = n // 2
		if square(temp):
			ans = 1
	if n % 4 == 0 and ans == 0:
		temp = n // 4
		if square(temp):
			ans = 1
	if ans:
		print('YES')
	else:
		print('NO')


import math

def isperfectsq(x):
	if x >= 1:
		sr = int(math.sqrt(x))
		return sr * sr == x
	return False
for i in range(int(input())):
	n = int(input())
	(A, a, flag) = ([], 1, 0)
	while a < 31:
		A.append(pow(2, a))
		a += 1
	for i in A:
		x1 = n / i
		if isperfectsq(x1):
			flag = 1
	print('YES' if flag else 'NO')


import math
for t in range(int(input())):
	n = int(input())
	flag = False
	for i in range(1, 31):
		if 2 ** i == n:
			print('YES')
			flag = True
			break
	if flag == False:
		power = 0
		while n % 2 == 0:
			power += 1
			n //= 2
		if math.sqrt(n) % 1 == 0 and power > 0:
			print('YES')
		else:
			print('NO')


import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
input = sys.stdin.readline
getS = lambda : input().strip()
getN = lambda : int(input())
getList = lambda : list(map(int, input().split()))
getZList = lambda : [int(x) - 1 for x in input().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)

def nck(n, k, kaijyo):
	return npk(n, k, kaijyo) * divide(kaijyo[k]) % MOD

def npk(n, k, kaijyo):
	if k == 0 or k == n:
		return n % MOD
	return kaijyo[n] * divide(kaijyo[n - k]) % MOD

def fact_and_inv(SIZE):
	inv = [0] * SIZE
	fac = [0] * SIZE
	finv = [0] * SIZE
	inv[1] = 1
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	for i in range(2, SIZE):
		inv[i] = MOD - MOD // i * inv[MOD % i] % MOD
		fac[i] = fac[i - 1] * i % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD
	return (fac, finv)

def renritsu(A, Y):
	A = np.matrix(A)
	Y = np.matrix(Y)
	Y = np.reshape(Y, (-1, 1))
	X = np.linalg.solve(A, Y)
	return X.flatten().tolist()[0]

class TwoDimGrid:

	def __init__(self, h, w, wall='#'):
		self.h = h
		self.w = w
		self.size = (h + 2) * (w + 2)
		self.wall = wall
		self.get_grid()

	def get_grid(self):
		grid = [self.wall * (self.w + 2)]
		for i in range(self.h):
			grid.append(self.wall + getS() + self.wall)
		grid.append(self.wall * (self.w + 2))
		self.grid = grid

	def init_cost(self):
		self.cost = [INF] * self.size

	def pos(self, x, y):
		return y * (self.w + 2) + x

	def getgrid(self, x, y):
		return self.grid[y][x]

	def get(self, x, y):
		return self.cost[self.pos(x, y)]

	def set(self, x, y, v):
		self.cost[self.pos(x, y)] = v
		return

	def show(self):
		for i in range(self.h + 2):
			print(self.cost[(self.w + 2) * i:(self.w + 2) * (i + 1)])

	def showsome(self, tgt):
		for t in tgt:
			print(t)
		return

	def showsomejoin(self, tgt):
		for t in tgt:
			print(''.join(t))
		return

	def search(self):
		grid = self.grid
		move = [(0, 1), (0, -1), (1, 0), (-1, 0)]
		move_eight = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]

class BIT:

	def __init__(self, n):
		self.n = n
		self.BIT = [0] * (n + 2)

	def query(self, idx):
		res_sum = 0
		while idx > 0:
			res_sum += self.BIT[idx]
			idx -= idx & -idx
		return res_sum

	def update(self, idx, x):
		while idx <= self.n:
			self.BIT[idx] += x
			idx += idx & -idx
		return

	def show(self):
		print(self.BIT)

def solve():
	n = getN()
	if n % 2 == 1:
		print('NO')
		return
	n //= 2
	for i in range(n + 1):
		if i ** 2 == n or i ** 2 == n * 2:
			print('YES')
			return
		if i ** 2 > n * 2:
			print('NO')
			return

def ran():
	n = random.randint(1, 100)
	li = [random.choice(['B', 'R', 'W']) for i in range(n)]
	return (n, li)

def main():
	n = getN()
	for _ in range(n):
		solve()
	return
main()


import math
t = int(input())
i = 1
while i <= t:
	n = int(input())
	k = n / 2
	ans = 0
	if n % 2 == 0 and math.ceil(math.sqrt(k)) == math.floor(math.sqrt(k)):
		ans = 1
	k = n / 4
	if n % 4 == 0 and math.ceil(math.sqrt(k)) == math.floor(math.sqrt(k)):
		ans = 1
	if ans == 0:
		print('NO')
	else:
		print('YES')
	i = i + 1


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
allTriangles = set()
ii = 1
while ii * ii * 2 <= 10 ** 9:
	allTriangles.add(ii * ii * 2)
	ii += 1
ii = 1
while ii * ii * 4 <= 10 ** 9:
	allTriangles.add(ii * ii * 4)
	ii += 1
tests = inp()
for _ in range(tests):
	n = inp()
	if n in allTriangles:
		print('YES')
	else:
		print('NO')