A string is called square if it is some string written twice in a row. For example, the strings "aa", "abcabc", "abab" and "baabaa" are square. But the strings "aaa", "abaaab" and "abcdabc" are not square.

For a given string $s$ determine if it is square.


-----Input-----

The first line of input data contains an integer $t$ ($1 \le t \le 100$) —the number of test cases.

This is followed by $t$ lines, each containing a description of one test case. The given strings consist only of lowercase Latin letters and have lengths between $1$ and $100$ inclusive.


-----Output-----

For each test case, output on a separate line:

YES if the string in the corresponding test case is square,

NO otherwise.

You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response).


-----Examples-----

Input
10
a
aa
aaa
aaaa
abab
abcabc
abacaba
xxyy
xyyx
xyxy
Output
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES


-----Note-----

None

Difficulty: EASY
Tags: String algorithms

Implementation

Starter code:

Solutions:
n = int(input())
for i in range(n):
	out = input()
	if len(out) % 2 == 0:
		mid = len(out) // 2
		a = out[:mid]
		if a * 2 == out:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


for _ in range(int(input())):
	word = input()
	if len(word) % 2 != 0:
		print('NO')
	else:
		ans = 'Yes'
		for i in range(int(len(word) / 2)):
			if word[i] != word[int(i + len(word) / 2)]:
				ans = 'NO'
				break
		print(ans)


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	if l % 2:
		print('NO')
	elif s[:l // 2] == s[l // 2:]:
		print('YES')
	else:
		print('NO')


def is_square_string(string: str):
	result = False
	length = len(string)
	if length % 2 == 0:
		length_half = int(length / 2)
		string1 = string[:length_half]
		string2 = string[length_half:]
		if string1 == string2:
			result = True
	return result
cases = int(input())
for i in range(0, cases):
	string = input()
	if is_square_string(string):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	a = input()
	if len(a) % 2 == 0:
		b = a[:len(a) // 2]
		c = a[len(a) // 2:]
		if list(b) == list(c):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	if len(s) % 2 == 1:
		print('NO')
	else:
		for i in range(1, len(s) // 2 + 1):
			if s.count(s[:i]) * len(s[:i]) == len(s) and s.count(s[:i]) % 2 == 0:
				print('YES')
				break
		else:
			print('NO')


n = int(input())
for _ in range(n):
	str = input()
	if len(str) % 2 == 0:
		if str[0:len(str) // 2] == str[len(str) // 2:len(str)]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = input()
	if len(a) % 2 == 1:
		print('NO')
	elif a[:len(a) // 2] == a[len(a) // 2:]:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	w = input()
	if len(w) % 2 != 0:
		print('NO')
	else:
		p1 = w[:int(len(w) / 2)]
		m = int(len(w) / 2)
		p2 = w[m:]
		if p1 == p2:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	a = input()
	if len(a) % 2 != 0:
		print('NO')
	else:
		l = len(a) // 2
		b = a[:l]
		c = a[l:]
		f = 0
		for i in range(l):
			if b[i] != c[i]:
				f += 1
				break
		if f == 1:
			print('NO')
		else:
			print('YES')


t = int(input())
for i in range(t):
	a = input()
	l = len(a)
	if l % 2 == 0:
		a1 = a[:l // 2]
		a2 = a[l // 2:]
		if a1 == a2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
while t:
	t = t - 1
	s = input()
	n = len(s)
	if n % 2 != 0:
		print('NO')
	else:
		l = n // 2
		c = l
		p = 0
		while l:
			l = l - 1
			n = n - 1
			if s[l] == s[n]:
				p = p + 1
		if p == c:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	str1 = input()
	n = len(str1)
	if n % 2 == 0:
		if str1[0:int(n / 2)] == str1[int(n / 2):n]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
while t:
	s = input()
	n = len(s)
	h = n / 2
	if n % 2 == 0:
		s1 = s[0:int(h)]
		s2 = s[int(h):int(n)]
		if s1 == s2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t -= 1


t = int(input())
input_list = []
for i in range(t):
	input_list.append(input())
while input_list:
	s = input_list.pop(0)
	if len(s) % 2 != 0:
		print('NO')
		continue
	if s[:len(s) // 2] == s[len(s) // 2:]:
		print('YES')
	else:
		print('NO')


f = int(input())
for i in range(f):
	n = input()
	if len(n) % 2 != 0:
		print('NO')
	else:
		l = list(n)
		h = []
		s = ''
		l = len(n)
		t = l // 2
		for i in range(t):
			h.append(n[i])
		s = s.join(h)
		if n[t:].find(s) == -1:
			print('NO')
		else:
			print('YES')


t = int(input())
for o in range(t):
	n = input()
	if len(n) % 2 != 0:
		print('NO')
	else:
		d = len(n) // 2
		b = n[0:d]
		c = n[d:]
		if b == c:
			print('YES')
		else:
			print('NO')


t = int(input(''))
for i in range(t):
	n = input('')
	if len(n) % 2 == 1:
		print('NO')
	else:
		t1 = n[0:len(n) // 2]
		t2 = n[len(n) // 2:]
		if t1 == t2:
			print('YES')
		else:
			print('NO')


n = int(input())
list1 = []
for i in range(n):
	list1.append(input())
for i in list1:
	if len(i) % 2 != 0:
		print('NO')
		continue
	for j in range(len(i) // 2):
		if j == len(i) // 2 - 1:
			if i[j] == i[len(i) // 2 + j]:
				print('YES')
		if i[j] == i[len(i) // 2 + j]:
			continue
		else:
			print('NO')
			break


import sys
from collections import deque
import math
from bisect import bisect_left
from functools import cmp_to_key

def II():
	return int(sys.stdin.readline())

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

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

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

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
for _ in range(II()):
	s = list(SI())
	if len(s) % 2 == 0 and s[len(s) // 2:] == s[:len(s) // 2]:
		print('YES')
	else:
		print('NO')


def find(s):
	n = len(s)
	if n % 2 == 1:
		return 'NO'
	left = s[0:int(n / 2)]
	right = s[int(n / 2):n]
	if left == right:
		return 'YES'
	return 'NO'
cases = int(input())
for _ in range(cases):
	s = input()
	print(find(s))


T = int(input())
for i in range(T):
	s = input()
	if len(s) % 2 == 0:
		a = ''
		b = ''
		for j in range(len(s) // 2):
			a = a + s[j]
			b = b + s[j + len(s) // 2]
		if a == b:
			print('yes')
		else:
			print('no')
	else:
		print('no')


for i in range(int(input())):
	s = input()
	if len(s) % 2 != 0:
		print('NO')
	else:
		k = int(len(s) / 2)
		if s[:k] == s[k:]:
			print('YES')
		else:
			print('NO')


from math import inf, gcd, log, log2, floor, ceil
from collections import Counter, defaultdict
DIRS = [[1, 0], [0, 1], [0, -1], [-1, 0]]
MOD = 10 ** 9 + 7

def get_lines():
	while 1:
		try:
			yield input()
		except:
			break
matrix = 0
array = 0
if matrix:
	A = []
	for line in lines:
		A.append([int(x) for x in line])
	(R, C) = (len(A), len(A[0]))
if array:
	A = [int(x) for x in lines]
	N = len(A)
N = int(input())
for _ in range(N):
	x = input()
	if len(x) & 1:
		print('NO')
		continue
	if x[len(x) // 2:] == x[:len(x) // 2]:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	s = input()
	if len(s) % 2 != 0:
		print('NO')
		continue
	j = len(s) // 2
	i = 0
	flag = False
	while j < len(s):
		if s[i] != s[j]:
			flag = True
			break
		i += 1
		j += 1
	if flag:
		print('NO')
	else:
		print('YES')


T = int(input())
for i in range(T):
	a = input()
	b = len(a)
	c = a[0:int(b / 2)]
	d = a[int(b / 2):]
	if b % 2 == 0 and c == d:
		print('YES')
	else:
		print('NO')


TestNumbers = int(input())
for i in range(TestNumbers):
	word = input()
	if len(word) == 1:
		print('NO')
	elif len(word) % 2 != 0:
		print('NO')
	else:
		word1 = word[0:len(word) // 2]
		word2 = word[len(word) // 2:]
		if word1 == word2:
			print('YES')
		else:
			print('NO')


t = int(input())
while t > 0:
	n = input()
	length = len(n)
	if length % 2 != 0:
		print('NO')
	elif n[:int(length / 2)] == n[int(length / 2):]:
		print('YES')
	else:
		print('NO')
	t -= 1


for i in range(int(input())):
	s = input()
	if len(s) % 2 != 0:
		print('No')
	else:
		for i in range(len(s) // 2):
			if s[i] != s[i + len(s) // 2]:
				print('No')
				break
		else:
			print('Yes')


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	if l % 2 == 0:
		half_len = l // 2
		check = False
		for j in range(half_len):
			if s[j] != s[j + half_len]:
				print('NO')
				check = True
				break
		if not check:
			print('YES')
	else:
		print('NO')


import sys
for _ in range(int(sys.stdin.readline())):
	s = sys.stdin.readline()[:-1]
	l = len(s) // 2
	print('YES' if s[:l] == s[l:] else 'NO')


t = int(input())
for _ in range(t):
	s = input()
	print('YES' if len(s) % 2 == 0 and s[:len(s) // 2] == s[len(s) // 2:] else 'NO')


for _ in range(int(input())):
	s = input()
	l = len(s) // 2
	print('YES' if s[:l] == s[l:] else 'NO')


qu = []
for _ in range(int(input())):
	qu.append(input())
for q in qu:
	s = q
	if len(s) % 2 == 1:
		print('NO')
	else:
		mid = len(s) // 2
		s1 = s[:mid]
		s2 = s[mid:]
		if s1 == s2:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	string = input()
	length_of_str = len(string)
	if length_of_str % 2 != 0:
		print('NO')
	else:
		half_length_of_str = int(length_of_str / 2)
		if string[:half_length_of_str] == string[half_length_of_str:]:
			print('YES')
		else:
			print('NO')


a = int(input())
data = []
for i in range(a):
	x = input()
	data.append(x)

def filt(g):
	if len(g) % 2 == 1:
		return 'NO'
	else:
		hlf = int(len(g) / 2)
		if g[:hlf] == g[hlf:]:
			return 'YES'
		else:
			return 'NO'
sol = list(map(filt, data))
for i in sol:
	print(i)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	x = input()
	y = len(x) - 1
	start = x[:y // 2].strip()
	end = x[y // 2:].strip()
	if start == end:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	s = str(input())
	ans = 0
	if len(s) % 2 == 0:
		for i in range(0, len(s) // 2):
			if s[i] != s[i + len(s) // 2]:
				ans = 1
	else:
		ans = 1
	if ans == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
arr = []
for i in range(n):
	arr.append(input())
for st in arr:
	l = len(st)
	if l % 2 == 0:
		if st[:l // 2] == st[l // 2:]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


sus = int(input())
for i in range(sus):
	maa = input()
	boo = len(maa)
	if boo % 2 == 1:
		print('NO')
		continue
	half = boo // 2
	if maa[:half] == maa[half:]:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	flag = 1
	if n % 2 == 0:
		(p1, p2) = (0, n // 2)
		for i in range(n // 2):
			if s[p1] != s[p2]:
				flag = 0
				break
			else:
				flag = 1
			p1 += 1
			p2 += 1
		if flag == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


count = int(input())
cnt = 0
for i in range(count):
	words = input()
	size = len(words)
	if size % 2 == 1:
		print('NO')
	else:
		middle = size // 2
		for j in range(middle):
			if words[j] == words[middle]:
				j += 1
				middle += 1
				cnt += 1
				if middle == size and cnt == size / 2:
					print('YES')
			else:
				print('NO')
				break
	cnt = 0


n = int(input())
a = []
an = []
for i in range(n):
	a.append(input(''))
	l = len(a[i])
	if l % 2 != 0:
		an.append('NO')
		continue
	m = int(l / 2)
	for j in range(m):
		if a[i][j] != a[i][m + j]:
			an.append('NO')
			break
		else:
			if j == m - 1:
				an.append('YES')
			continue
for i in range(n):
	print(an[i])


n = int(input())
for i in range(n):
	s = input()
	if len(s) % 2 != 0:
		print('NO')
		continue
	if s[0:len(s) // 2] == s[len(s) // 2:]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = str(input())
	mid = int(len(s) / 2)
	if len(s) % 2 != 0:
		print('NO')
	else:
		sone = s[0:mid]
		stwo = s[mid:len(s)]
		if sone == stwo:
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(n):
	a = str(input())
	a = [a for a in a]
	l = len(a) // 2
	t = 1
	if len(a) % 2 != 0:
		t = 0
	elif len(a) % 2 == 0:
		for j in range(l):
			if a[j] != a[j + l]:
				t = 0
	if t == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	s = input()
	k = list(s)
	p = len(k)
	if p % 2 != 0:
		print('NO')
	else:
		c = 0
		for j in range(p // 2):
			if k[j] == k[p // 2 + j]:
				c += 1
		if c == p // 2:
			print('YES')
		else:
			print('NO')


import sys
for _ in range(int(sys.stdin.readline())):
	s = input()
	if len(s) % 2 == 1:
		print('NO')
		continue
	x = len(s) // 2
	if s[:x] == s[x:]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	n = len(s)
	if n % 2 != 0:
		print('NO')
	elif s[:n // 2] == s[n // 2:]:
		print('YES')
	else:
		print('NO')


for s in [*open(0)][1:]:
	n = len(s)
	print('YNEOS'[s[:n // 2] != s[n // 2:-1]::2])


n = int(input())
for i in range(n):
	string = input()
	l = len(string) // 2
	s1 = string[:l]
	s2 = string[l:]
	if s1 == s2:
		print('YES')
	else:
		print('NO')


def solution():
	t = int(input())
	for i in range(t):
		s = input()
		n = len(s)
		if n % 2 == 0:
			flag = True
			(index1, index2) = (0, n // 2)
			while index1 < index2 and index2 < n:
				if s[index1] != s[index2]:
					flag = False
					break
				index1 += 1
				index2 += 1
			if flag:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
solution()


t = int(input())
for i in range(t):
	string1 = input()
	if len(string1) % 2 != 0:
		print('NO')
	else:
		for j in range(int(len(string1) / 2)):
			if string1[j] != string1[int(len(string1) / 2) + j]:
				print('NO')
				break
		else:
			print('YES')


import sys
t = int(input())
result = 'NO'
for i in range(t):
	word = str(input())
	if len(word) % 2 == 0:
		if word[:int(len(word) / 2)] == word[int(len(word) / 2):len(word)]:
			result = 'YES'
		else:
			result = 'NO'
	else:
		result = 'NO'
	print(result)


t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	if n % 2 == 1:
		print('NO')
	elif s[:n // 2] == s[n // 2:]:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	s = input()
	l = len(s)
	if l % 2 == 1:
		print('NO')
	else:
		temp = s[0:l // 2]
		if temp * 2 == s:
			print('YES')
		else:
			print('NO')


from collections import deque as de
import math
import sys
from math import sqrt as sq
from math import floor as fl
from math import ceil as ce
from sys import stdin, stdout
import time
sys.setrecursionlimit(10 ** 7)
from collections import Counter as cnt
from functools import reduce
from itertools import groupby as gb
from bisect import bisect_left as bl, bisect_right as br
from typing import Coroutine

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def __iter__(self):
		return iter(self.data)

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0

	def len(self):
		return len(self.data)
arrStack = My_stack()

class graph:

	def __init__(self):
		self.graphdict = {}

	def add_edge(self, node, neighbor):
		if node not in self.graphdict:
			self.graphdict[node] = [neighbor]
		else:
			self.graphdict[node].append(neighbor)

	def show_edge(self):
		for node in self.graphdict:
			for neighbors in self.graphdict:
				print(node, neighbors)

	def show_graph(self):
		return self.graphdict

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

def binarytodecimal(n):
	return int(n, 2)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

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

def getProduct(n):
	product = 1
	while n != 0:
		product = product * (n % 10)
		n = n // 10
	return product

def regularBracketsequence(str, arrStack):
	for i in range(len(str)):
		if str[i] == '(':
			arrStack.my_push(str[i])
		elif arrStack.isEmpty():
			return False
		else:
			arrStack.my_pop()
	if arrStack.isEmpty():
		return True
	else:
		return False

def lcm(x, y):
	lcm = x * y // math.gcd(x, y)
	return lcm

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

def checkisap(list):
	d = list[1] - list[0]
	for i in range(2, len(list)):
		temp = list[i] - list[i - 1]
		if temp != d:
			return False
	return True

def primes_method5(n):
	out = {}
	sieve = [True] * (n + 1)
	for p in range(2, n + 1):
		if sieve[p]:
			out[p] = 1
			for i in range(p, n + 1, p):
				sieve[i] = False
	return out

def id(i, j, col):
	ans = (i - 1) * col
	ans += j
	return ans

def getSum(n):
	strr = str(n)
	list_of_number = list(map(int, strr.strip()))
	return sum(list_of_number)

def checkperfectsquare(n):
	if ce(sq(n)) == fl(sq(n)):
		return True
	else:
		return False

def combinatrics(n, r):
	num = n
	deno = n - r
	pr = 1
	for i in range(num, deno, -1):
		pr *= i
	an = 1
	for i in range(1, r + 1):
		an *= i
	ans = pr // an
	return ans

def ceildiv(x, y):
	return (x + y - 1) // y

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

def ii():
	return int(input())

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

def si():
	return list(map(str, input()))

def indict():
	dic = {}
	for (index, value) in enumerate(input().split()):
		dic[int(value)] = int(index)
	return dic

def frqdict():
	dic = {}
	for (index, value) in enumerate(input()):
		if value not in dic:
			dic[value] = 1
		else:
			dic[value] += 1
	return dic
t = ii()
while t:
	t -= 1
	s = si()
	ln = len(s)
	if ln % 2:
		print('NO')
	elif s[:ln // 2] == s[ln // 2:]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	for i in range(len(s)):
		if s[:i + 1] == s[i + 1:]:
			print('YES')
			break
	else:
		print('NO')


def issquare(s):
	k = len(s)
	if k % 2 == 0 and s[:k // 2] * 2 == s:
		return 'YES'
	return 'NO'
for i in range(int(input())):
	print(issquare(str(input())))


for i in range(int(input())):
	s = input()
	if len(s) % 2 != 0:
		print('NO')
	else:
		s1 = s[0:len(s) // 2]
		s2 = s[len(s) // 2:len(s)]
		if s1 == s2:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	s = input()
	n = len(s)
	flag = 0
	for i in range(n):
		for j in range(i + 1, n):
			x = s[i:j + 1]
			y = s[j + 1:j + 1 + j - i + 1]
			if x == y and n == len(x) + len(y):
				flag = 1
				break
		if flag:
			break
	if flag or (n == 2 and s[0] == s[1]):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	test_case = input()
	if len(test_case) % 2 == 1:
		print('No')
	else:
		index = int(len(test_case) / 2)
		first_half = test_case[:index]
		second_half = test_case[index:]
		if first_half == second_half:
			print('Yes')
		else:
			print('No')


n = int(input())
s = []
for i in range(n):
	s.append(input())
for x in range(0, n):
	f = True
	v = s[x]
	if len(v) % 2 != 0:
		print('No')
	else:
		h = int(len(v) / 2)
		for i in range(h, len(v)):
			if v[i] != v[i - h]:
				print('No')
				f = False
				break
		if f:
			print('Yes')


for k in range(int(input())):
	st = input()
	if len(st) % 2 == 1:
		print('NO')
	elif st[:len(st) // 2] == st[len(st) // 2:]:
		print('YES')
	else:
		print('NO')


a = int(input(''))
for i in range(a):
	m = 1
	string = list(input(''))
	length = len(string)
	l2 = int(length / 2)
	if length % 2 != 0:
		print('NO')
		m = 0
	else:
		for j in range(l2):
			if string[j] != string[j + l2]:
				print('NO')
				m = 0
				break
	if m == 1:
		print('YES')


import sys
import math
from typing import AnyStr
INF = int(1000000000000000.0 + 1)
mod = 1000000007
read = sys.stdin.readline
sys.setrecursionlimit(10 ** 5)
dx = [0, 1, 0, -1]
dy = [-1, 0, 1, 0]
seg = []

def power(bottom, up):
	if up == 1:
		return bottom
	elif up == 0:
		return 1
	tmp = power(bottom, int(up // 2))
	if up % 2 == 0:
		return tmp * tmp % mod
	else:
		return tmp * tmp * bottom % mod

def ccw(p1, p2, p3):
	a = p2[0] - p1[0]
	b = p2[1] - p1[1]
	c = p3[0] - p1[0]
	d = p3[1] - p1[1]
	tmp = a * d - b * c
	if tmp > 0:
		return 1
	elif tmp == 0:
		return 0
	else:
		return -1

def lower_bound(item):
	left = 0
	right = len(queue)
	while left < right:
		mid = int((left + right) // 2)
		if queue[mid] > item:
			right = mid
		elif queue[mid] <= item:
			left = mid + 1
	return int((left + right) // 2)

def make_seg(left, right, node):
	if left == right:
		seg[node] = arr[left - 1]
		return seg[node]
	mid = int((left + right) // 2)
	seg[node] = make_seg(left, mid, node * 2)
	seg[node] += make_seg(mid + 1, right, node * 2 + 1)
	return seg[node]

def seg_replace(left, right, node, index, diff):
	if index < left or index > right:
		return
	seg[node] += diff
	if left == right:
		return
	mid = (left + right) // 2
	seg_replace(left, mid, node * 2, index, diff)
	seg_replace(mid + 1, right, node * 2 + 1, index, diff)

def seg_sum(left, right, start, end, node):
	if start <= left and right <= end:
		return seg[node]
	if end < left or start > right:
		return 0
	mid = (left + right) // 2
	return seg_sum(left, mid, start, end, node * 2) + seg_sum(mid + 1, right, start, end, node * 2 + 1)

def lazy_seg_replace(left, right, node, start, end, diff):
	if seg_lazy[node] != 0:
		seg[node] += seg_lazy[node] * (right - left + 1)
		if left != right:
			seg_lazy[node * 2] += seg_lazy[node]
			seg_lazy[node * 2 + 1] += seg_lazy[node]
		seg_lazy[node] = 0
	if start <= left and right <= end:
		seg_lazy[node] += diff
		seg[node] += seg_lazy[node] * (right - left + 1)
		if left != right:
			seg_lazy[node * 2] += seg_lazy[node]
			seg_lazy[node * 2 + 1] += seg_lazy[node]
		seg_lazy[node] = 0
		return seg[node]
	if end < left or start > right:
		return seg[node]
	mid = (left + right) // 2
	seg[node] = lazy_seg_replace(left, mid, node * 2, start, end, diff)
	seg[node] += lazy_seg_replace(mid + 1, right, node * 2 + 1, start, end, diff)
	return seg[node]

def lazy_seg_sum(left, right, node, start, end):
	if seg_lazy[node] != 0:
		seg[node] += seg_lazy[node] * (right - left + 1)
		if left != right:
			seg_lazy[node * 2] += seg_lazy[node]
			seg_lazy[node * 2 + 1] += seg_lazy[node]
		seg_lazy[node] = 0
	if start <= left and right <= end:
		tmp = seg[node]
		seg[node] = 0
		return tmp
	if end < left or right < start:
		return 0
	mid = (left + right) // 2
	if mid >= end:
		tmp = lazy_seg_sum(left, mid, node * 2, start, end)
	else:
		tmp = lazy_seg_sum(mid + 1, right, node * 2 + 1, start, end)
	seg[node] -= tmp
	return tmp

def seg_index(left, right, node, idx):
	seg[node] -= 1
	if left == right:
		return left
	mid = (left + right) // 2
	if seg[node * 2] < idx:
		return seg_index(mid + 1, right, node * 2 + 1, idx - seg[node * 2])
	else:
		return seg_index(left, mid, node * 2, idx)
num = int(read())
answer_li = []
for _ in range(num):
	word = list(read().strip())
	if len(word) % 2 != 0:
		answer_li.append('NO')
		continue
	chk = True
	for idx in range(len(word) // 2):
		if word[idx] != word[idx + len(word) // 2]:
			chk = False
			break
	if chk:
		answer_li.append('YES')
	else:
		answer_li.append('NO')
print('\n'.join(answer_li))


for t in range(int(input())):
	s = input()
	k = len(s)
	f = 1
	if k % 2 == 1:
		f = 0
	else:
		p1 = k // 2 - 1
		p2 = k - 1
		while p1 >= 0 and p2 >= k // 2:
			if s[p1] != s[p2]:
				f = 0
				break
			p1 -= 1
			p2 -= 1
	if f:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	temp = 1
	L = len(s)
	if L % 2:
		temp = 0
	else:
		for i in range(L // 2):
			if s[i] != s[i + L // 2]:
				temp = 0
				break
	print('YES' if temp else 'NO')


def func(s):
	n = len(s)
	if n % 2 != 0:
		return False
	if s[:n // 2] == s[n // 2:]:
		return True
	else:
		return False
t = int(input())
for i in range(t):
	s = input()
	if func(s):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	if len(s) % 2 != 0:
		print('NO')
	else:
		n = len(s)
		x = s[:n // 2]
		y = s[n // 2:]
		if x == y:
			print('YES')
		else:
			print('NO')


import math

def solve():
	for t in range(int(input())):
		s = input()
		if len(s) % 2 == 0:
			m = len(s) // 2
			t = s[:m] == s[m:]
			if t:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
solve()


t = int(input())
for _ in range(t):
	s = input()
	l = len(s)
	if len(s) % 2 == 1:
		print('No')
	else:
		s1 = s[:l // 2]
		s2 = s[l // 2:]
		if s1 == s2:
			print('Yes')
		else:
			print('No')


t = int(input())
while t > 0:
	text = input()
	if len(text) % 2 == 0:
		if text[0:int(len(text) / 2)] == text[int(len(text) / 2):]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t -= 1


a = int(input())
ans = []
q = []
for i in range(a):
	b = input()
	q.append(b)
for i in q:
	l = len(i)
	if l % 2 == 1:
		print('NO')
	else:
		x = i[0:int(l / 2)]
		y = i[int(l / 2):]
		if x == y:
			print('YES')
		else:
			print('NO')


t = int(input())
a = []
s = 0
for i in range(t):
	a.append(input())
	b = len(a[i])
	if b % 2 == 0:
		for j in range(b // 2):
			if a[i][j] == a[i][b // 2 + j]:
				s += 1
		if s == b // 2:
			print('YES')
			s = 0
		else:
			s = 0
			print('NO')
	else:
		print('NO')


T = int(input())
for t in range(T):
	s = input()
	if len(s) % 2 != 0:
		print('NO')
		continue
	if s[:len(s) // 2] == s[len(s) // 2:]:
		print('YES')
	else:
		print('NO')


m = int(input())
for i in range(m):
	a = input()
	b = list(a)
	b1 = b[len(a) // 2:]
	b2 = b[:len(a) // 2]
	if len(a) % 2 != 0:
		print('NO')
	elif b1 == b2:
		print('YES')
	else:
		print('NO')


def Solve():
	string1 = input()
	len1 = len(string1) // 2
	print('YES' if string1[:len1] == string1[len1:] else 'NO')
for _ in range(int(input())):
	Solve()


for x in range(int(input())):
	n = input()
	if len(n) % 2 == 0:
		s = len(n) // 2
		c = 0
		for y in range(s):
			if n[y] == n[s + y]:
				c += 1
			else:
				break
		if c == s:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


for i in range(int(input())):
	s = input('')
	if len(s) % 2 != 0:
		print('NO')
	else:
		x = int(len(s) / 2)
		for j in range(x):
			if s[j] != s[x + j]:
				res = 'NO'
				break
			else:
				res = 'YES'
				continue
		print(res)


for _ in range(int(input())):
	s = input()
	if len(s) % 2 == 1:
		print('NO')
	elif s[:len(s) // 2] == s[len(s) // 2:]:
		print('YES')
	else:
		print('NO')


def function(testCases):
	while testCases != 0:
		string = input()
		if len(string) % 2 == 1:
			print('NO')
			testCases -= 1
			continue
		list1 = []
		for i in string:
			list1.append(i)
		list2 = []
		list3 = []
		for j in range(0, int(len(string) / 2)):
			list2.append(list1[j])
		for k in range(int(len(string) / 2), len(string)):
			list3.append(list1[k])
		string1 = ''.join(list2)
		string2 = ''.join(list3)
		if string1 == string2:
			print('YES')
		else:
			print('NO')
		testCases -= 1
function(int(input()))


for _ in range(int(input())):
	ss = input()
	if len(ss) % 2 != 0:
		print('NO')
	else:
		(f, s) = (ss[:len(ss) // 2], ss[len(ss) // 2:])
		if f == s:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	s = input()
	k = len(s)
	if k & 1:
		print('NO')
	else:
		j = k // 2
		if s[:j] == s[j:]:
			print('YES')
		else:
			print('NO')


num = int(input())
while num:
	str = input()
	lstr = str[:len(str) // 2]
	rstr = str[len(str) // 2:]
	if lstr == rstr:
		print('YES')
	else:
		print('NO')
	num -= 1


import sys
import os.path
from collections import *
import math
import bisect
import heapq as hq
from fractions import Fraction
from random import randint
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = sys.stdin.readline

def solve():
	s = input().strip('\n')
	if len(s) % 2:
		print('NO')
		return
	n = len(s)
	if s[:n // 2] == s[n // 2:]:
		print('YES')
	else:
		print('NO')
t = int(input())
while t:
	t -= 1
	solve()


N = int(input())
for _ in range(N):
	S = input()
	ls = len(S)
	if ls % 2 != 0:
		print('NO')
	elif S[0:ls // 2] == S[ls // 2:]:
		print('YES')
	else:
		print('NO')


a = int(input())
sp = []
for i in range(a):
	b = input()
	sp.append(b)
for g in range(a):
	d = sp[g]
	if len(d) % 2 != 0:
		print('NO')
	else:
		z = len(d) // 2
		h = d[:z]
		g = d[z:]
		if h == g:
			print('YES')
		else:
			print('NO')


t = int(input())
while t > 0:
	s = input()
	count = 0
	l = len(s)
	m = l // 2
	if l % 2 != 0:
		print('NO')
	else:
		for i in range(0, m):
			if s[i] == s[i + m]:
				count += 1
		if count == m:
			print('YES')
		else:
			print('NO')
	t -= 1


n = int(input())
for i in range(n):
	string = str(input())
	l = len(string)
	if l == 1 or l % 2 == 1:
		print('NO')
	else:
		f = 0
		for (a, b) in zip(range(int(l / 2)), range(int(l / 2), l)):
			if string[a] != string[b]:
				f = 1
				break
			else:
				continue
		if f == 0:
			print('YES')
		else:
			print('NO')


a = int(input())
c = ''
for i in range(a):
	b = input()
	if len(b) % 2 == 1:
		print('No')
	else:
		l = len(b)
		for i in range(int(l / 2)):
			c = c + b[0]
			b = b[1:]
		if c == b:
			print('YES')
		else:
			print('NO')
	c = ''
	b = ''


import sys

def read_line():
	return sys.stdin.readline().strip()
t = int(read_line())
for _ in range(t):
	s = read_line()
	n = len(s)
	print(f"{('YES' if n % 2 == 0 and s[:n // 2] == s[n // 2:] else 'NO')}")


def repeated_word(word):
	n = len(word) // 2
	return word[:n] == word[n:]
t = int(input())
for i in range(0, t):
	s = input()
	if repeated_word(s):
		print('YES')
	else:
		print('NO')


def process(s):
	if len(s) % 2 == 1:
		return False
	else:
		return s[0:int(len(s) / 2)] == s[int(len(s) / 2):]
t = int(input())
for i in range(t):
	s = input()
	b = process(s)
	if b:
		print('YES')
	else:
		print('NO')


v = int(input())
for k in range(v):
	input_string = input()
	mid = len(input_string) // 2
	fhalf = input_string[:mid]
	shalf = input_string[mid:]
	if fhalf == shalf:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	s = input()
	le = len(s)
	mid = len(s) // 2
	if le % 2 == 1:
		print('NO')
		continue
	if s[:mid] == s[mid:]:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	input1 = input()
	mid = len(input1) // 2
	fh = input1[:mid]
	sh = input1[mid:]
	if fh == sh:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	mystr = input()
	length = len(mystr)
	if len(mystr) % 2 == 1:
		print('NO')
	elif mystr[:length // 2] == mystr[length // 2:]:
		print('YES')
	else:
		print('NO')


def func():
	s = input()
	l = len(s)
	if l % 2 == 0 and s[:l // 2] == s[l // 2:]:
		print('YES')
	else:
		print('NO')

def main():
	for i in range(int(input())):
		func()
main()


n = int(input())
for i in range(0, n):
	s = input()
	l = len(s)
	if l % 2 != 0:
		fg = 0
	else:
		d = int(l / 2)
		for j in range(0, d):
			if s[j] == s[d + j]:
				fg = 1
			else:
				fg = 0
				break
	if fg == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	s = input()
	l = []
	for j in range(len(s) // 2):
		l.append(s[j])
	li = []
	for j in range(len(s) // 2, len(s)):
		li.append(s[j])
	if l == li:
		print('YES')
	else:
		print('NO')


from collections import Counter
a = int(input())
for i in range(a):
	result = 0
	s = input()
	if len(s) % 2 != 0:
		result = 1
	else:
		divider = len(s) // 2
		token1 = s[:divider]
		token2 = s[divider:]
		if token1 != token2:
			result = 1
	if result == 0:
		print('Yes')
	else:
		print('No')


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		S = input()
		l = len(S)
		ans = 'NO'
		if not l % 2:
			s1 = S[:l // 2]
			s2 = S[l // 2:]
			if s1 == s2:
				ans = 'YES'
		print(ans)
main()


test = int(input())
for t in range(test):
	s = input()
	n = len(s)
	if n % 2 == 1:
		print('NO')
	else:
		s1 = s[0:n // 2]
		s2 = s[n // 2:n]
		if s1 == s2:
			print('YES')
		else:
			print('NO')


n = int(input())
BREAK_OUT_FOR = False
for i in range(0, n):
	two_words = input()
	if len(two_words) % 2 == 1:
		print('NO')
	else:
		size_two_words = int(len(two_words) / 2)
		for j in range(0, size_two_words):
			if two_words[j] != two_words[j + size_two_words]:
				BREAK_OUT_FOR = True
				break
		if BREAK_OUT_FOR:
			print('NO')
		else:
			print('YES')
		BREAK_OUT_FOR = False


for t in range(int(input())):
	s = input()
	n = len(s)
	if n % 2 == 0:
		s1 = s[0:n // 2:1]
		s2 = s[n // 2::1]
		if s1 == s2:
			print('yes')
		else:
			print('no')
	else:
		print('no')


q = int(input())
for a in range(q):
	p = input()
	l = len(p)
	if l % 2 == 0:
		p1 = p[:l // 2]
		p2 = p[l // 2:]
		if p1 == p2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	st = input()
	if len(st) % 2 != 0:
		print('NO')
	else:
		start = st[:len(st) // 2]
		end = st[len(st) // 2:]
		if start == end:
			print('YES')
		else:
			print('NO')


cases = int(input())
finalstring = ''
for case in range(cases):
	currentcase = input()
	if currentcase[:int(len(currentcase) / 2)] == currentcase[int(len(currentcase) / 2):]:
		finalstring += 'YES\n'
	else:
		finalstring += 'NO\n'
print(finalstring)


x = int(input())
for i in range(x):
	a = input()
	if a[0:len(a) // 2] == a[len(a) // 2:len(a)]:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	s = input()
	if len(s) % 2 == 1:
		print('NO')
	else:
		flag = True
		for i in range(0, len(s) // 2):
			if s[i] != s[i + len(s) // 2]:
				flag = False
				break
		if flag:
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(n):
	st = input()
	t = len(st)
	sub = ''
	sub1 = ''
	if t % 2 != 0:
		print('NO')
	else:
		sub = st[0:t // 2]
		sub1 = st[t // 2:t]
		if sub == sub1:
			print('YES')
		else:
			print('NO')


n = int(input())
while n:
	n -= 1
	sr = input()
	if len(sr) % 2 == 0:
		a = len(sr) // 2
		count = 0
		for i in range(a):
			sum1 = sr[i]
			sum2 = sr[a + i]
			if sum1 == sum2:
				count += 1
		if count == a:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
i = 0
ans = []
while i < t:
	f = input()
	if len(f) % 2 == 0:
		if f[0:len(f) // 2] == f[len(f) // 2:]:
			ans.append('YES')
		else:
			ans.append('NO')
	else:
		ans.append('NO')
	i += 1
for j in ans:
	print(j)


t = int(input())
while t > 0:
	s = input()
	k = ''
	if len(s) % 2 != 0:
		print('NO')
	else:
		z = len(s) // 2
		for i in range(z):
			k += s[i]
		z = s.count(k)
		p = len(k)
		if p * z == len(s):
			print('YES')
		else:
			print('NO')
	t -= 1


import sys

def square_string(s):
	l = len(s)
	if l % 2 == 1:
		return 'NO'
	if s[:l // 2] == s[l // 2:]:
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	s = input()
	sys.stdout.write(f'{square_string(s)}\n')


i = int(input())
inputs = []
for i in range(i):
	inputs.append(input())
for i in inputs:
	if len(i) % 2 == 0:
		if i[:len(i) // 2] == i[len(i) // 2:]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


def isSquare(s):
	if len(s) % 2 == 1:
		return False
	return True if s[:len(s) // 2] == s[len(s) // 2:] else False
for _ in range(int(input())):
	print('YES') if isSquare(input()) else print('NO')


import sys, os, getpass
import math, random
import functools, itertools, collections, heapq, bisect
from collections import Counter, defaultdict, deque
input = sys.stdin.readline

def read_matrix(rows):
	return [list(map(int, input().split())) for _ in range(rows)]

def read_strings(rows):
	return [input().strip() for _ in range(rows)]

def readint():
	return int(input())

def readstr():
	return list(map(str, input().split()))
cases = readint()

def solve(s):
	for i in range(len(s)):
		if s[:i] == s[i:]:
			return 'YES'
	return 'NO'
for _ in range(int(cases)):
	arr = readstr()
	orig = solve(arr[0])
	print(orig)


t = int(input())
for _ in range(t):
	s = input()
	l = len(s)
	if l % 2 != 0:
		print('NO')
		continue
	s1 = s[:l // 2]
	s2 = s[l // 2:]
	if s1 == s2:
		print('YES')
		continue
	print('NO')


t = int(input())
for k in range(t):
	s = input()
	d = len(s)
	if s[0:d // 2] == s[d // 2:]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	if len(s) % 2:
		print('NO')
	else:
		a = s[:len(s) // 2]
		if s.count(a) == 2:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	string = input()
	if len(string) % 2 == 1:
		print('NO')
	elif string[:len(string) // 2:1] == string[len(string) // 2:]:
		print('YES')
	else:
		print('NO')


t = int(input())
p = []
for i in range(t):
	s = str(input())
	l1 = []
	l2 = []
	if len(s) % 2 == 0:
		k = len(s) // 2
		l1 = s[:k]
		l2 = s[k:]
		if l1 == l2:
			p.append('YES')
		else:
			p.append('NO')
	else:
		p.append('NO')
print(*p, sep='\n')


T = int(input())
for t in range(T):
	s = input()
	m = len(s) // 2
	if len(s) % 2 != 0:
		print('NO')
	elif s[:m] == s[m:]:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	n = input()
	if len(n) % 2 != 0:
		print('NO')
	else:
		a = len(n) // 2
		if n[:len(n) // 2] == n[len(n) // 2:]:
			print('YES')
		else:
			print('NO')
	t -= 1


n = int(input())
for _ in range(n):
	s = input()
	x = len(s) // 2
	if len(s) % 2 == 1:
		print('NO')
		continue
	if s[:x] == s[x:]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = input()
	l = len(n)
	if l % 2 == 1:
		print('NO')
	else:
		k = l // 2
		if n[:k] == n[k:]:
			print('YES')
		else:
			print('NO')


p = int(input())
while p:
	s = str(input())
	if len(s) % 2 != 0:
		print('NO')
	else:
		n = len(s) // 2
		if s[:n] == s[n:]:
			print('YES')
		else:
			print('NO')
	p -= 1


t = int(input())
term = 1
for i in range(t):
	n = input()
	if len(n) % 2 != 0:
		term = 0
	else:
		for i in range(len(n) // 2):
			if n[i] != n[len(n) // 2 + i]:
				term = 0
				break
			else:
				term = 1
	if term == 0:
		print('NO')
	else:
		print('YES')


from collections import defaultdict
for _ in range(int(input())):
	s = input()
	ok = True
	if len(s) % 2 != 0:
		ok = False
	mid = len(s) // 2
	for i in range(mid):
		if s[i] != s[i + mid]:
			ok = False
	if ok:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	s = input()
	if s[0:math.ceil(len(s) / 2)] == s[math.ceil(len(s) / 2):]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	length = len(s)
	if length % 2 != 0:
		print('NO')
		continue
	mid = length // 2
	if s[:mid] == s[mid:]:
		print('YES')
	else:
		print('NO')


def solve(s):
	n = len(s)
	if n % 2:
		print('No')
	elif s[:n // 2] == s[n // 2:]:
		print('Yes')
	else:
		print('No')
q = int(input())
while q:
	s = input()
	solve(s)
	q -= 1


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	if l % 2 == 0:
		k = ''
		a = ''
		l = l - 1
		m = int(l / 2)
		for j in range(m + 1):
			k = k + s[j]
		f = m + 1
		while f <= l:
			a = a + s[f]
			f = f + 1
		if a == k:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


s = []
for _ in range(int(input())):
	s.append(str(input()))
for i in s:
	x = len(i) // 2
	if i[x:] == i[:x]:
		print('YES')
	else:
		print('NO')


from collections import deque, defaultdict
from math import sqrt, ceil, factorial, floor, inf, log2, sqrt, gcd
import bisect
import copy
from itertools import combinations
import sys
import heapq

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

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	s = input()
	n = len(s)
	if n % 2 == 1:
		print('NO')
	else:
		n1 = n // 2
		s1 = s[:n1]
		s2 = s[n1:]
		if s1 == s2:
			print('YES')
		else:
			print('NO')


tests = int(input())
for test in range(tests):
	stroka = input()
	if len(stroka) % 2 != 0:
		print('NO')
	else:
		first = stroka[0:len(stroka) // 2]
		second = stroka[len(stroka) // 2:]
		if first == second:
			print('YES')
		else:
			print('NO')


def check(s):
	if len(s) % 2 == 0:
		l = len(s)
		if s[:int(l / 2)] == s[int(l / 2):]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
for i in range(int(input())):
	s = input()
	check(s)


n = int(input())
count = 0
while count != n:
	inputs = str(input())
	count += 1
	list1 = []
	list1[:0] = inputs
	length = len(list1)
	if length % 2 == 0 and length != 1:
		middle_index = length // 2
		first_half = list1[:middle_index]
		second_half = list1[middle_index:]
		if first_half == second_half:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	s = input()
	a = len(s)
	if a % 2 == 0:
		if s[0:a // 2] == s[a // 2:]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
res = []
for i in range(t):
	s = input()
	l = len(s)
	if l % 2 == 1:
		res.append('NO')
	else:
		(i, m, square) = (0, l // 2, True)
		while m < l:
			if s[i] != s[m]:
				square = False
				break
			i += 1
			m += 1
		if square:
			res.append('YES')
		else:
			res.append('NO')
for r in res:
	print(r)


t = int(input())
for _ in range(t):
	inp = input()
	if len(inp) % 2 != 0:
		print('NO')
	else:
		mid = len(inp) // 2
		if inp[:mid] == inp[mid:]:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	string = input()
	s_len = len(string)
	if s_len % 2 == 1:
		print('NO')
	elif string[:s_len // 2] == string[s_len // 2:]:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	a = input()
	if a[:len(a) // 2] == a[len(a) // 2:] and len(a) % 2 == 0:
		print('YES')
	else:
		print('NO')


a = int(input())
for i in range(a):
	s = input()
	l = len(s)
	if l % 2 == 0:
		if s[0:l // 2] == s[l // 2:l]:
			print('yes')
		else:
			print('no')
	else:
		print('no')


from __future__ import unicode_literals
from __future__ import print_function
import time
import math
import random
a = int(input())
i = 0
while i < a:
	j = 0
	str = input()
	if len(str) % 2 == 1:
		print('NO')
	else:
		not_same = 0
		length = len(str)
		slider1 = 0
		slider2 = int(length / 2)
		while slider2 < length:
			if str[slider1] != str[slider2]:
				not_same = 1
				break
			slider2 += 1
			slider1 += 1
		if not_same == 0:
			print('YES')
		else:
			print('NO')
	i += 1


def squarestring(string):
	x = len(string)
	if x % 2 == 1:
		return False
	if string[:x // 2] == string[x // 2:]:
		return True
	else:
		return False
ls = []
for i in range(int(input())):
	string = input()
	if squarestring(string):
		ls.append('YES')
	else:
		ls.append('NO')
for i in ls:
	print(i)


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	if l % 2 != 0:
		l1 = s[0:int(l / 2)]
		l2 = s[int(l / 2) + 1:0]
	else:
		l1 = s[0:int(l / 2)]
		l2 = s[int(l / 2):]
	l11 = list(l1)
	l22 = list(l2)
	if l != 1:
		if l11 == l22:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for i in range(t):
	str = input()
	if len(str) % 2 != 0:
		print('NO')
	elif str[:len(str) // 2] == str[len(str) // 2:]:
		print('YES')
	else:
		print('NO')


import math

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

def input_multiple():
	return map(int, input().split())
t = input_int()
while t > 0:
	s = input()
	if len(s) % 2 == 0:
		(i, h) = (0, len(s) // 2)
		flag = True
		while i < h:
			if s[i] != s[h + i]:
				flag = False
				break
			i += 1
		if flag:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t -= 1


n = int(input())
for i in range(n):
	a = input()
	y = 'YES'
	o = len(a) // 2
	if o == 0 or len(a) % 2 != 0 or a.count(a[0:o]) != 2:
		y = 'NO'
	print(y)


t = int(input())
for _ in range(t):
	s = list(input())
	if len(s) % 2 == 0:
		n = len(s) // 2
		if s[:n] == s[n:]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from sys import stdin
test = int(stdin.readline())
for t in range(test):
	s = stdin.readline().rstrip()
	if len(s) % 2 == 1:
		print('NO')
	elif s[:len(s) // 2] == s[len(s) // 2:]:
		print('YES')
	else:
		print('NO')


import math, os, io, heapq
from sys import stdin, stdout
from collections import Counter, deque, defaultdict
from itertools import product
import bisect

def getList(method=int):
	return list(map(method, input().split()))

def getInt():
	return int(input())

def solve():
	s = input()
	n = len(s)
	if n % 2:
		return 'NO'
	k = n // 2
	for i in range(k):
		if s[i] != s[i + k]:
			return 'NO'
	return 'YES'
for _ in range(getInt()):
	print(solve())


import os
import random
import sys
from collections import Counter
from heapq import heapify, heappop
from itertools import *
from io import BytesIO, IOBase
from math import inf, gcd

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

def sieve():
	global spf, adj, MAXN
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(2, MAXN):
		if i * i > MAXN:
			break
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def getdistinctFactorization(n):
	global adj, spf, MAXN
	for i in range(1, n + 1):
		index = 1
		x = i
		if x != 1:
			adj[i].append(spf[x])
		x = x // spf[x]
		while x != 1:
			if adj[i][index - 1] != spf[x]:
				adj[i].append(spf[x])
				index += 1
			x = x // spf[x]

def printDivisors(n):
	i = 2
	z = [1, n]
	while i <= sqrt(n):
		if n % i == 0:
			if n / i == i:
				z.append(i)
			else:
				z.append(i)
				z.append(n // i)
		i = i + 1
	return z

def create(n, x, f):
	pq = len(bin(n)[2:])
	if f == 0:
		tt = min
	else:
		tt = max
	dp = [[inf] * n for _ in range(pq)]
	dp[0] = x
	for i in range(1, pq):
		for j in range(n - (1 << i) + 1):
			dp[i][j] = tt(dp[i - 1][j], dp[i - 1][j + (1 << i - 1)])
	return dp

def enquiry(l, r, dp, f):
	if l > r:
		return inf if not f else -inf
	if f == 1:
		tt = max
	else:
		tt = min
	pq1 = len(bin(r - l + 1)[2:]) - 1
	return tt(dp[pq1][l], dp[pq1][r - (1 << pq1) + 1])

def SieveOfEratosthenes(n):
	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
	x = []
	for i in range(2, n + 1):
		if prime[i]:
			x.append(i)
	return x

def main():
	for _ in range(int(input())):
		s = list(input().strip())
		n = len(s)
		if n % 2:
			print('NO')
		elif s[:n // 2] + s[:n // 2] == s:
			print('YES')
		else:
			print('NO')
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())):
	s = str(input())
	l = len(s)
	if l % 2 == 0:
		if s[:l // 2] == s[l // 2:]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for i in range(t):
	string = input()
	if len(string) % 2 == 1:
		print('NO')
		continue
	if string[:int(len(string) / 2)] != string[int(len(string) / 2):]:
		print('NO')
		continue
	print('YES')


for _ in range(int(input())):
	a = input()
	b = len(a)
	c = int(b / 2)
	flag = 0
	if b % 2 != 0:
		flag = 0
	elif a[0:c] == a[c:b]:
		flag = 1
	if flag == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
y = []
for i in range(0, t):
	n = input()
	if len(n) % 2 != 0:
		y.append('NO')
	else:
		a = int(len(n) / 2)
		if n[:a] == n[a:]:
			y.append('YES')
		else:
			y.append('NO')
for j in range(0, t):
	print(y[j])


t = int(input())
for _ in range(t):
	n = input()
	k = len(n)
	m = k // 2
	s = m
	c = 0
	if k % 2 == 0:
		for i in range(0, m):
			if n[i] == n[s]:
				c += 1
				s += 1
			else:
				break
	if c == m and k != 1:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	s = input()
	flag = 1
	n = len(s)
	if n % 2:
		flag = 0
	else:
		for i in range(n // 2):
			if s[i] != s[i + n // 2]:
				flag = 0
				break
	print('YES' if flag else 'NO')


for _ in range(int(input())):
	a = input()
	if a[0:len(a) // 2] == a[len(a) // 2:]:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	strg = str(input())
	if len(strg) % 2 != 0:
		print('NO')
	else:
		mid = len(strg) // 2
		if strg[:mid] == strg[mid:]:
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(n):
	S = input()
	l = len(S)
	if len(S) % 2 != 0:
		print('NO')
	elif S[:l // 2] == S[l // 2:]:
		print('YES')
	else:
		print('NO')


def answer():
	s = input()
	n = len(s)
	if s[:n // 2] == s[n // 2:]:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	answer()


import sys
from sys import stdin, stdout
from math import ceil, floor, sqrt, log, log2, log10
from collections import Counter
int_max = float('inf')
int_min = -float('inf')
mod = 10 ** 9 + 7
ANS = []
input = stdin.readline

def solve():
	pass
t = int(input())
for i in range(t):
	s = input().strip()
	n = len(s)
	if n % 2 == 1:
		print('NO')
		continue
	if s[:n // 2] == s[n // 2:n]:
		print('YES')
	else:
		print('NO')