You are given a string $s$ consisting of $n$ lowercase Latin letters. $n$ is even.

For each position $i$ ($1 \le i \le n$) in string $s$ you are required to change the letter on this position either to the previous letter in alphabetic order or to the next one (letters 'a' and 'z' have only one of these options). Letter in every position must be changed exactly once.

For example, letter 'p' should be changed either to 'o' or to 'q', letter 'a' should be changed to 'b' and letter 'z' should be changed to 'y'.

That way string "codeforces", for example, can be changed to "dpedepqbft" ('c' $\rightarrow$ 'd', 'o' $\rightarrow$ 'p', 'd' $\rightarrow$ 'e', 'e' $\rightarrow$ 'd', 'f' $\rightarrow$ 'e', 'o' $\rightarrow$ 'p', 'r' $\rightarrow$ 'q', 'c' $\rightarrow$ 'b', 'e' $\rightarrow$ 'f', 's' $\rightarrow$ 't').

String $s$ is called a palindrome if it reads the same from left to right and from right to left. For example, strings "abba" and "zz" are palindromes and strings "abca" and "zy" are not.

Your goal is to check if it's possible to make string $s$ a palindrome by applying the aforementioned changes to every position. Print "YES" if string $s$ can be transformed to a palindrome and "NO" otherwise.

Each testcase contains several strings, for each of them you are required to solve the problem separately.


-----Input-----

The first line contains a single integer $T$ ($1 \le T \le 50$) — the number of strings in a testcase.

Then $2T$ lines follow — lines $(2i - 1)$ and $2i$ of them describe the $i$-th string. The first line of the pair contains a single integer $n$ ($2 \le n \le 100$, $n$ is even) — the length of the corresponding string. The second line of the pair contains a string $s$, consisting of $n$ lowercase Latin letters.


-----Output-----

Print $T$ lines. The $i$-th line should contain the answer to the $i$-th string of the input. Print "YES" if it's possible to make the $i$-th string a palindrome by applying the aforementioned changes to every position. Print "NO" otherwise.


-----Example-----
Input
5
6
abccba
2
cf
4
adfa
8
abaazaba
2
ml

Output
YES
NO
YES
NO
NO



-----Note-----

The first string of the example can be changed to "bcbbcb", two leftmost letters and two rightmost letters got changed to the next letters, two middle letters got changed to the previous letters.

The second string can be changed to "be", "bg", "de", "dg", but none of these resulting strings are palindromes.

The third string can be changed to "beeb" which is a palindrome.

The fifth string can be changed to "lk", "lm", "nk", "nm", but none of these resulting strings are palindromes. Also note that no letter can remain the same, so you can't obtain strings "ll" or "mm".

Difficulty: EASY
Tags: String algorithms

Implementation

Starter code:

Solutions:
def srk(s, n):
	z = n
	if s == s[::-1]:
		return 1
	for i in range(z // 2):
		if s[i] == s[n - i - 1]:
			continue
		elif s[i] != s[n - i - 1]:
			if abs(ord(s[i]) - ord(s[n - i - 1])) == 2:
				continue
			else:
				return 0
	if n == 2:
		if abs(ord(s[0]) - ord(s[1])) == 2:
			return 1
		else:
			return 0
	return 1
t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	p = srk(s, n)
	if p == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = True
	for (a, b) in zip(s[:n // 2], s[::-1]):
		(x, y) = map(ord, (a, b))
		if abs(x - y) not in (0, 2):
			ans = False
			break
	if ans:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	l = int(input())
	s = list(input().strip())
	f = 1
	for j in range(0, int(l / 2)):
		y = abs(ord(s[j]) - ord(s[l - 1 - j]))
		if y == 1 or y > 2:
			f = 0
			break
	if f:
		print('YES')
	else:
		print('NO')


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	n = n // 2
	flag = 1
	for a in range(n):
		if s[a] == s[2 * n - 1 - a]:
			continue
		if abs(ord(s[a]) - ord(s[2 * n - 1 - a])) == 2:
			continue
		else:
			flag = 0
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')


import sys
t = int(sys.stdin.readline())
for inp in range(t):
	n = int(sys.stdin.readline())
	s = sys.stdin.readline().strip()
	ans = 'YES'
	for pos in range(n // 2 + n % 2):
		delta = abs(ord(s[pos]) - ord(s[-1 - pos]))
		if delta != 0 and delta != 2:
			ans = 'NO'
	print(ans)


n = int(input())
for i in range(n):
	len = int(input())
	s = input()
	flag = True
	for j in range(len):
		d = abs(ord(s[j]) - ord(s[len - 1 - j]))
		if not (abs(d) == 0 or abs(d) == 2):
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


def search(s, n):
	for i in range(n // 2):
		x = abs(ord(s[i]) - ord(s[n - i - 1]))
		if x != 0 and x != 2:
			return False
	return True
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	if search(s, n):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, s) = (int(input()), input())
	print('YES' if all([abs(ord(s[i]) - ord(s[n - 1 - i])) in [0, 2] for i in range(n // 2)]) else 'NO')


def main():
	tn = int(input())
	while tn > 0:
		l = int(input())
		s = str(input())
		h = int(l / 2)
		ans = str('YES')
		dif = int(0)
		for i in range(0, h):
			x = ord(s[l - i - 1])
			y = ord(s[i])
			dif = x - y
			if dif < 0:
				dif = 0 - dif
			if dif > 2 or dif == 1:
				ans = 'NO'
				break
		print(ans)
		tn = tn - 1
main()


g = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	n = int(input())
	x = input()
	p = 0
	for i in range(n):
		if g.find(x[i]) + 1 == g.find(x[n - i - 1]) - 1 or g.find(x[i]) - 1 == g.find(x[n - i - 1]) + 1 or x[i] == x[n - i - 1]:
			p += 1
	if p == n:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	lens = int(input())
	ins = input()
	ans = 'YES'
	for (x, y) in zip(ins, ins[::-1]):
		if ord(x) - ord(y) not in [2, 0, -2]:
			ans = 'NO'
			break
	print(ans)


t = int(input())
for _ in range(t):
	length = int(input())
	letters = list(input())
	i = 0
	j = length - 1
	flag = True
	while i != j and i < j:
		ordi = ord(letters[i])
		ordj = ord(letters[j])
		dif = abs(ordi - ordj)
		if dif == 0 or dif == 2:
			i = i + 1
			j = j - 1
		else:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


def check(s, n):
	az = ['a', 'z']
	v = [0, 2]
	for i in range(0, n // 2):
		if s[i] in az and s[n - i - 1] in az:
			if s[i] != s[n - i - 1]:
				return 'NO'
		elif s[i] in az or s[n - i - 1] in az:
			z = sorted([s[i], s[n - i - 1]])
			if ord(z[1]) - ord(z[0]) != 2:
				return 'NO'
		elif abs(ord(s[i]) - ord(s[n - i - 1])) not in v:
			return 'NO'
	return 'YES'
for _ in range(int(input())):
	n = int(input())
	s = [i for i in input()]
	ans = check(s, n)
	print(ans)


t = int(input())
for ti in range(t):
	n = int(input())
	s = str(input())
	yes = True
	for p in range(n // 2):
		yes = abs(abs(ord(s[p]) - ord(s[n - 1 - p])) - 1) == 1
		if not yes:
			break
	print('YES' if yes else 'NO')


n = int(input())
a = [0] * n
b = [0] * n
for i in range(n):
	b[i] = int(input())
	a[i] = str(input())
for i in range(n):
	s = 0
	for j in range(b[i] // 2):
		t = abs(ord(a[i][j]) - ord(a[i][b[i] - 1 - j]))
		if t > 2 or t == 1:
			s = 1
			break
	if s == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	s = list(input())
	k = 0
	c = 0
	for j in range(n // 2):
		k = n - 1 - j
		t = abs(ord(s[k]) - ord(s[j]))
		if t == 2 or t == 0:
			c += 1
	if c == n // 2:
		print('YES')
	else:
		print('NO')


import string
qtd = int(input())
words = []
for inp in range(0, qtd):
	size = int(input())
	words.append(input())
for w in words:
	for count in range(0, int(len(w) / 2)):
		if abs(string.ascii_lowercase.index(w[count]) - string.ascii_lowercase.index(w[-count - 1])) not in [0, 2]:
			print('NO')
			break
		else:
			count += 1
	else:
		print('YES')


p = int(input())
for q in range(p):
	n = int(input())
	s = input()
	count = 0
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) == 0 or abs(ord(s[i]) - ord(s[n - i - 1])) == 2:
			count += 1
	if count == n // 2:
		print('YES')
	else:
		print('NO')


USE_STDIO = False
if not USE_STDIO:
	try:
		import mypc
	except:
		pass

def check(s):
	(i, j) = (0, len(s) - 1)
	while i < j:
		if abs(ord(s[i]) - ord(s[j])) not in [0, 2]:
			return False
		(i, j) = (i + 1, j - 1)
	return True

def main():
	(T,) = map(int, input().split(' '))
	for _ in range(T):
		(n,) = map(int, input().split(' '))
		s = input()
		print(['NO', 'YES'][check(s)])
main()


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	m = n // 2
	f = 1
	for j in range(m):
		if s[j] != s[n - 1 - j] and abs(ord(s[j]) - ord(s[n - 1 - j])) != 2:
			f = 0
	if f == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	l = int(input())
	s = input()
	flag = 0
	for j in range(l // 2):
		if not (s[j] == s[l - j - 1] or ord(s[j]) + 1 == ord(s[l - j - 1]) - 1 or ord(s[j]) - 1 == ord(s[l - j - 1]) + 1):
			print('NO')
			flag = 1
			break
	if flag == 0:
		print('YES')


def isPalindrome():
	(n, s) = (int(input()), input())
	for i in range(n // 2):
		d = ord(s[i]) - ord(s[n - 1 - i])
		if not (max(d, -d) == 2 or max(d, -d) == 0):
			print('NO')
			return
	print('YES')
t = int(input())
for i in range(t):
	isPalindrome()


for x in range(int(input())):
	n = int(input())
	s = input()[:n]
	z = True
	for y in range(0, n, 2):
		try:
			if s[y] != s[n - 1 - y]:
				if ord(s[y]) + 1 == ord(s[n - 1 - y]) - 1 or ord(s[y]) - 1 == ord(s[n - 1 - y]) + 1:
					continue
				else:
					print('NO')
					z = False
					break
		except:
			continue
	if z == True:
		print('YES')


t = int(input())
for x in range(1, t + 1):
	n = int(input())
	s = input()
	for i in range(0, int(n / 2)):
		j = n - i - 1
		diff = ord(s[i]) - ord(s[j])
		if diff == -2 or diff == 0 or diff == 2:
			score = 1
			continue
		else:
			score = 0
			break
	if score == 0:
		print('NO')
	else:
		print('YES')


i = int(input())
l = 'abcdefghijklmnopqrstuvwxyz'
for j in range(0, i):
	n = int(input())
	s = str(input())
	u = 'YES'
	for k in range(0, int(n / 2 + 1)):
		m1 = 0
		m2 = 0
		for t in range(0, 26):
			if l[t] == s[k]:
				m1 = t
			if l[t] == s[n - k - 1]:
				m2 = t
		if abs(m1 - m2) >= 3 or abs(m1 - m2) == 1:
			u = 'NO'
	print(u)


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	ck = 0
	for i in range(0, int(n / 2)):
		if (s[i] == s[n - 1 - i] or abs(ord(s[i]) - ord(s[n - 1 - i])) == 2) == False:
			ck = 1
			break
	if ck == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


def isPalindrome(string):
	for i in range(int(len(string) / 2)):
		if not isSame(string[i], string[len(string) - i - 1]):
			return False
	return True

def isSame(a, b):
	dist = abs(ord(a) - ord(b))
	return dist == 2 or dist == 0
n = int(input(''))
for i in range(n):
	string = input('')
	string = input('')
	if isPalindrome(string):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	k = [0, 2]
	flag = 0
	for i in range(0, n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) not in k:
			flag = 1
	if flag == 0:
		print('YES')
	else:
		print('NO')


import sys
import math
from collections import deque

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

def print_primes_till_n(n):
	(i, j, flag) = (0, 0, 0)
	a = []
	c = 0
	for i in range(1, n + 1, 1):
		if i == 1 or i == 0:
			continue
		flag = 1
		for j in range(2, i // 2 + 1, 1):
			if i % j == 0:
				flag = 0
				break
		if flag == 1:
			a.append(i)
			c += 1
	return (a, c)

def is_square(n):
	b = math.sqrt(n)
	if n == int(b * b):
		return True
	return False

def solution():
	for _ in range(int(input())):
		n = int(input())
		s = input()
		s = [i for i in s]
		c = 0
		for i in range(n // 2):
			if abs(ord(s[n - i - 1]) - ord(s[i])) == 2 or abs(ord(s[n - i - 1]) - ord(s[i])) == 0:
				c += 1
			else:
				c = -1
				break
		if c == n // 2:
			print('YES')
		else:
			print('NO')
solution()


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	(i, j) = (0, len(s) - 1)
	while i < j:
		asc_i = ord(s[i])
		asc_j = ord(s[j])
		asc_i_1 = asc_i - 1
		asc_i_2 = asc_i + 1
		asc_j_1 = asc_j + 1
		asc_j_2 = asc_j - 1
		if asc_i_1 != asc_j_1 and asc_i_1 != asc_j_2 and (asc_i_2 != asc_j_1) and (asc_i_2 != asc_j_2):
			print('NO')
			break
		i += 1
		j -= 1
	else:
		print('YES')


t = int(input())
import string
string = string.ascii_lowercase
while t > 0:
	n = int(input())
	s = input()
	res = True
	for i in range(n // 2):
		if s[i] == s[n - i - 1] or abs(ord(s[i]) - ord(s[n - i - 1])) == 2:
			continue
		else:
			res = False
			break
	if res:
		print('YES')
	else:
		print('NO')
	t -= 1


for t in range(int(input())):
	n = int(input())
	s = input()
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) == 1 or abs(ord(s[i]) - ord(s[n - i - 1])) > 2:
			print('NO')
			break
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	s = list(input())
	for i in range(n):
		s[i] = ord(s[i]) - 97
	ok = True
	for i in range(n // 2):
		if s[i] == s[-i - 1]:
			continue
		if s[i] == s[-i - 1] - 2 and s[-i - 1] > 1:
			continue
		if s[i] == s[-i - 1] + 2:
			continue
		print('NO')
		ok = False
		break
	if ok:
		print('YES')


mod = 10 ** 9 + 7

def readInt():
	return int(input())

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

def readStringList():
	return list(input())

def readStringListWithSpace():
	return list(input().split())

def readString():
	return input()

def execute():
	t = readInt()
	for _ in range(t):
		n = readInt()
		s = readString()
		(i, j, f) = (0, n - 1, True)
		while i < j:
			if abs(ord(s[i]) - ord(s[j])) not in [0, 2]:
				f = False
				break
			i += 1
			j -= 1
		if f:
			print('YES')
		else:
			print('NO')
execute()


import math
word_letters = int(input())
for x in range(word_letters):
	flag = 0
	length = int(input())
	word = input()
	for i in range(int(len(word) / 2)):
		if word[i] != word[len(word) - 1 - i] and int(math.fabs(ord(word[i]) - ord(word[len(word) - 1 - i]))) != 2:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')


def testaPalavra(s, n):
	if n % 2 != 0:
		return False
	m = n // 2
	for i in range(m):
		a = ord(s[i])
		b = ord(s[n - 1 - i])
		if a == ord('a'):
			a += 1
		elif a == ord('z'):
			a -= 1
		elif a > b:
			a -= 1
		else:
			a += 1
		if b == ord('a'):
			b += 1
		elif b == ord('z'):
			b -= 1
		elif b > a:
			b -= 1
		else:
			b += 1
		dist = abs(a - b)
		if dist != 0:
			return False
	return True
T = int(input())
n = [0] * T
s = [0] * T
for i in range(T):
	n[i] = int(input())
	s[i] = input()
for i in range(T):
	if testaPalavra(s[i], n[i]):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	j = 0
	stillOk = True
	h = n // 2
	while j < h and stillOk:
		b = ord(s[j])
		c = ord(s[n - 1 - j])
		if abs(b - c) not in (0, 2):
			stillOk = False
		j += 1
	print('YES') if stillOk else print('NO')


t = int(input())
for i in range(0, t):
	n = int(input())
	a = input()
	i = 0
	j = n - 1
	m = n // 2
	flag = 0
	while j >= m:
		if a[i] != a[j]:
			if abs(ord(a[i]) - ord(a[j])) != 2:
				flag = 1
				break
		j -= 1
		i += 1
	if flag == 1:
		print('NO')
	else:
		print('YES')


import sys
import os

def solve(s):
	n = len(s)
	for i in range(n // 2):
		a = ord(s[i])
		b = ord(s[n - 1 - i])
		diff = abs(a - b)
		if diff != 0 and abs(diff) != 2:
			return 'NO'
	return 'YES'

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

def __starting_point():
	main()
__starting_point()


def cin(obj=list, type=int, sep=' '):
	return obj(map(type, input().split(sep)))
(t,) = cin()
for _ in range(t):
	(n,) = cin()
	s = input()
	for i in range((n - 1) // 2 + 1):
		temp = abs(ord(s[i]) - ord(s[-i - 1]))
		if temp != 2 and temp:
			print('NO')
			break
	else:
		print('YES')


def main():
	t = int(input())
	a = [elem for elem in 'abcdefghijklmnopqrstuvwxyz']
	for i in range(t):
		n = int(input())
		s = input()
		for j in range(n // 2):
			sym1 = s[j]
			sym2 = s[n - j - 1]
			pos1 = a.index(sym1)
			pos2 = a.index(sym2)
			if pos1 == pos2 or abs(pos2 - pos1) == 2:
				continue
			else:
				print('NO')
				break
		else:
			print('YES')
main()


s = 'abcdefghijklmnopqrstuvwxyz'
d = {}
for k in range(26):
	if k == 0:
		d[s[k]] = [s[k + 1]]
	elif k == 25:
		d[s[k]] = [s[k - 1]]
	else:
		d[s[k]] = [s[k - 1], s[k + 1]]

def igual(s, k, d):
	if k == 'a' or k == 'z':
		return s == d[k][0]
	else:
		return s == d[k][0] or s == d[k][1]

def igual2(s1, k, d):
	if s1 == 'a' or s1 == 'z':
		return igual(d[s1][0], k, d)
	else:
		return igual(d[s1][0], k, d) or igual(d[s1][1], k, d)
n = int(input())
for k in range(n):
	inpu = int(input())
	t = input()
	res = 'YES'
	for j in range(inpu // 2):
		if not igual2(t[j], t[-(j + 1)], d):
			res = 'NO'
			break
	print(res)


t = int(input())
for i in range(t):
	l = int(input())
	s = input()
	flag = True
	for i in range(l // 2):
		if s[i] != s[l - i - 1] and abs(ord(s[i]) - ord(s[l - i - 1])) != 2:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')


num_cases = int(input())
for case in range(num_cases):
	n = int(input())
	s = input()
	solution = 'YES'
	for i in range(n // 2):
		d = abs(ord(s[i]) - ord(s[n - i - 1]))
		if not d == 0 and (not d == 2):
			solution = 'NO'
			break
	print(solution)


testcases = int(input().strip())
for testcase in range(testcases):
	n = int(input().strip())
	s = input().strip()
	flag = True
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[-i - 1])) > 2 or abs(ord(s[i]) - ord(s[-i - 1])) == 1:
			flag = False
	print('YES' if flag == True else 'NO')


for q in range(int(input())):
	a = int(input()) // 2
	s = input()
	f = 0
	for x in range(a):
		d = abs(ord(s[x]) - ord(s[-(x + 1)]))
		if d == 1 or d > 2:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')


alphabet = list('abcdefghijklmnopqrstuvwxyz')
T = int(input())
ansL = []
for i in range(T):
	n = int(input())
	s = list(str(input()))
	isTrue = True
	for j in range(int(n / 2)):
		if abs(alphabet.index(s[j]) - alphabet.index(s[n - 1 - j])) != 0 and abs(alphabet.index(s[j]) - alphabet.index(s[n - 1 - j])) != 2:
			isTrue = False
			break
	if isTrue:
		ansL.append('YES')
	else:
		ansL.append('NO')
for z in ansL:
	print(z)


for _ in range(int(input())):
	n = int(int(input()))
	s = input()
	ans = 'YES'
	for i in range(n // 2):
		c = abs(ord(s[i]) - ord(s[n - 1 - i]))
		if c > 2 or c == 1:
			ans = 'NO'
			break
	print(ans)


def is_palindrom(string):
	len_s = len(string)
	for i in range(len_s // 2):
		diff = abs(ord(string[i]) - ord(string[len_s - 1 - i]))
		if diff != 2 and diff != 0:
			return 'NO'
	return 'YES'
n = int(input())
for _ in range(n):
	m = int(input())
	print(is_palindrom(str(input())))


t = int(input())
while t > 0:
	flag = 0
	c = 0
	n = int(input())
	mstr = input()
	astr = mstr[0:n // 2:1]
	cstr = mstr[n // 2:n:1]
	bstr = cstr[::-1]
	for i in range(len(astr)):
		if astr[i] == bstr[i]:
			flag = 1
		elif ord(astr[i]) + 1 == ord(bstr[i]) - 1:
			flag = 1
		elif ord(bstr[i]) + 1 == ord(astr[i]) - 1:
			flag = 1
		else:
			flag = 2
		if flag == 1:
			c += 1
	if c == len(astr):
		print('YES')
	else:
		print('NO')
	t -= 1


def verify_is_palindromic_twist(word, size):
	half = size // 2
	is_palindrome_twist = True
	i = 0
	while i < half and is_palindrome_twist:
		if word[i] != word[size - i - 1]:
			ord_letter1 = ord(word[i])
			ord_letter2 = ord(word[size - i - 1])
			c1 = {ord_letter1 - 1, ord_letter1, ord_letter1 + 1}
			c2 = {ord_letter2 - 1, ord_letter2, ord_letter2 + 1}
			resulting = c1.intersection(c2)
			is_palindrome_twist = len(resulting) > 0 and ord_letter1 not in resulting and (ord_letter2 not in resulting)
		i += 1
	return is_palindrome_twist
n = int(input())
for _ in range(n):
	size = int(input())
	word = str(input())
	print('YES' if verify_is_palindromic_twist(word, size) else 'NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	f = 1
	i = 0
	while i < n // 2:
		d = abs(ord(s[i]) - ord(s[n - 1 - i]))
		if d > 2 or d == 1:
			f = 0
			break
		i += 1
	print('YES' if f else 'NO')


def check(n, s):
	for i in range(n // 2):
		(c1, c2) = (ord(s[i]), ord(s[n - i - 1]))
		if abs(c1 - c2) not in [2, 0]:
			return False
	return True
T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	if check(n, s):
		print('YES')
	else:
		print('NO')


t = int(input())
for test in range(t):
	m = int(input())
	s = input()
	f = 0
	s1 = s[:m // 2]
	s2 = s[m // 2:m]
	s2 = s2[::-1]
	l = []
	for j in range(m // 2):
		if abs(ord(s1[j])) - ord(s2[j]) != 0 and abs(ord(s1[j]) - ord(s2[j])) != 2:
			f = 1
			break
		else:
			f = 0
	if f == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(0, t):
	n = int(input())
	s = input()
	j = 0
	while j < n - j - 1:
		if s[j] != s[n - j - 1] and abs(ord(s[j]) - ord(s[n - j - 1])) != 2:
			break
		j += 1
	if j >= n - j - 1:
		print('YES')
	else:
		print('NO')


import string
N = int(input())
for i in range(N):
	n = int(input())
	s = input()
	yes = True
	low = string.ascii_lowercase
	for i in range(n // 2):
		diff = abs(low.find(s[i]) - low.find(s[-(i + 1)]))
		if diff != 2 and diff != 0:
			yes = False
			break
	if yes:
		print('YES')
	else:
		print('NO')


import sys, os, io
for _ in range(int(input())):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	while i < j:
		so = ord(s[i]) - 97
		eo = ord(s[j]) - 97
		if so == eo:
			i += 1
			j -= 1
			continue
		if abs(so - eo) > 2 or abs(so - eo) == 1:
			break
		else:
			i += 1
			j -= 1
	if i < j:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	s = input()
	x = 0
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[-i - 1])) != 2 and abs(ord(s[i]) - ord(s[-i - 1])) != 0:
			x = 1
			print('NO')
			break
	if x == 0:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	string = input()
	if string == string[::-1]:
		print('YES')
		continue
	temp = string[::-1]
	for i in range(n):
		x = ord(string[i])
		y = ord(temp[i])
		if x + 1 == y + 1 or x + 1 == y - 1 or x - 1 == y + 1 or (x - 1 == y - 1):
			continue
		print('NO')
		break
	else:
		print('YES')


from sys import stdin
trim = lambda s: s[:-1] if s[-1] == '\n' else s
T = int(stdin.readline())
for i in range(0, T):
	n = int(stdin.readline())
	s = trim(stdin.readline())
	possible = True
	for j in range(0, n // 2 + 1):
		if abs(ord(s[j]) - ord(s[-(j + 1)])) not in [0, 2]:
			possible = False
	if possible:
		print('YES')
	else:
		print('NO')


n = int(input())
rez = [''] * n
for i in range(0, n):
	l = int(input())
	s = input()
	ok = 1
	for j in range(0, l // 2):
		q = ord(s[j]) - ord(s[l - 1 - j])
		if q != 2 and q != -2 and (q != 0):
			ok = 0
	if ok == 1:
		rez[i] = 'YES'
	else:
		rez[i] = 'NO'
for i in range(0, n):
	print(rez[i])


t = int(input())
resp = []
for j in range(t):
	l = int(input())
	s = input()
	i = 0
	while i < l / 2 and (ord(s[i]) + 1 == ord(s[-i - 1]) + 1 or ord(s[i]) + 1 == ord(s[-i - 1]) - 1 or ord(s[i]) - 1 == ord(s[-i - 1]) - 1 or (ord(s[i]) - 1 == ord(s[-i - 1]) + 1)):
		i += 1
	if i == l / 2:
		resp.append('YES')
	else:
		resp.append('NO')
for i in resp:
	print(i)


for _ in range(int(input())):
	n = int(input())
	s = list(input())
	p = n
	flag = 1
	for i in range(0, n // 2):
		if s[i] == s[p - i - 1]:
			continue
		elif ord(s[i]) - 1 == ord(s[p - i - 1]) - 1 or ord(s[i]) - 1 == ord(s[p - i - 1]) + 1 or ord(s[i]) + 1 == ord(s[p - i - 1]) - 1 or (ord(s[i]) + 1 == ord(s[p - i - 1]) + 1):
			continue
		else:
			flag = 0
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


T = int(input())

def helper(s):
	flag = True
	for i in range(len(s) // 2):
		j = len(s) - i - 1
		if abs(ord(s[i]) - ord(s[j])) != 0 and abs(ord(s[i]) - ord(s[j])) != 2:
			flag = False
			break
	return flag
for i in range(T):
	n = int(input())
	s = input()
	flag = helper(s)
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	i = 0
	ans = 'YES'
	while i < n - i - 1 and ans == 'YES':
		a = ord(s[i])
		b = ord(s[n - i - 1])
		if a != b:
			if a > b:
				a ^= b
				b ^= a
				a ^= b
			if a + 1 != b - 1:
				ans = 'NO'
		i += 1
	print(ans)


n = int(input())
for i in range(n):
	a = int(input())
	b = input()
	f = 0
	for i in range(a // 2):
		if ord(b[i]) == ord(b[-i - 1]) - 2 or ord(b[i]) == ord(b[-i - 1]) + 2 or ord(b[i]) == ord(b[-i - 1]):
			k = 1
		else:
			f = 1
	if f == 0:
		print('YES')
	else:
		print('NO')


def palindrom(x):
	x = list(x)
	code = 1
	for i in range(0, int(len(x) / 2) + 1):
		x[i] = chr(ord(x[i]) + 1)
		x[len(x) - 1 - i] = chr(ord(x[len(x) - 1 - i]) + 1)
		if x[i] != x[len(x) - 1 - i]:
			x[len(x) - 1 - i] = chr(ord(x[len(x) - 1 - i]) - 2)
			if x[i] != x[len(x) - 1 - i]:
				x[i] = chr(ord(x[i]) - 2)
				if x[i] != x[len(x) - 1 - i]:
					x[len(x) - 1 - i] = chr(ord(x[len(x) - 1 - i]) + 2)
					if x[i] != x[len(x) - 1 - i]:
						code = 0
						break
	if code == 1:
		return True
	else:
		return False
n = int(input())
for i in range(0, n):
	input()
	tp = str(input())
	if palindrom(tp):
		print('YES')
	else:
		print('NO')


T = int(input())
while T:
	T -= 1
	n = int(input())
	s = input()
	ok = 1
	for i in range(0, n // 2):
		if abs(ord(s[i]) - ord(s[-1 - i])) != 2 and abs(ord(s[i]) - ord(s[-1 - i])) != 0:
			ok = 0
			break
	print(['NO', 'YES'][ok])


n = int(input())
for i in range(n):
	l = int(input())
	st = input()
	answer = 'YES'
	for j in range(l // 2):
		distance = abs(ord(st[j]) - ord(st[-j - 1]))
		if distance == 1 or distance > 2:
			answer = 'NO'
	print(answer)


def is_prev_or_next(a, b):
	return abs(ord(b) - ord(a)) == 0 or abs(ord(b) - ord(a)) == 2
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	k = n - 1
	fg = True
	for j in range(0, n // 2):
		if not is_prev_or_next(s[j], s[k]):
			fg = False
			break
		k -= 1
	if fg:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = True
	for (i, j) in zip(s[:n // 2], reversed(s[n // 2:])):
		if not {ord(i) - 1, ord(i) + 1} & {ord(j) - 1, ord(j) + 1}:
			ans = False
	print(['NO', 'YES'][ans])


for _ in range(int(input())):
	n = int(input())
	s = input()
	f = 1

	def check(a, b):
		return abs(ord(a) - ord(b)) == 2 or abs(ord(a) - ord(b)) == 0
	for i in range(n // 2):
		if not check(s[i], s[n - i - 1]):
			f = 0
			break
	print('YES' if f else 'NO')


T = int(input())
a = []
setalone = 'abcdefghijklmnopqrstuvwxyz'
for i in range(T):
	n = int(input())
	st = input()
	flag = 1
	for j in range(n // 2):
		if st[j] != st[n - j - 1] and abs(setalone.find(st[j]) - setalone.find(st[n - j - 1])) != 2:
			flag = 0
			break
	if flag == 0:
		a.append('NO')
	else:
		a.append('YES')
for i in range(T):
	print(a[i])


import math
from sys import stdin
n_round = int(stdin.readline())
for _ in range(n_round):
	n_letter = int(stdin.readline())
	string = list(stdin.readline().strip())
	numbers = [ord(x) for x in string]
	result = True
	for _ in range(math.floor(n_letter / 2)):
		if not (numbers[_] == numbers[-(_ + 1)] or abs(numbers[_] - numbers[-(_ + 1)]) == 2):
			result = False
	if result == True:
		print('YES')
	else:
		print('NO')


def palindromicTwist(size, string):
	isPalindromicTwist = True
	halfSize = int(size / 2)
	firstHalf = string[0:halfSize]
	secondHalf = string[halfSize:size][::-1]
	i = 0
	while i < halfSize and isPalindromicTwist:
		res = abs(ord(firstHalf[i]) - ord(secondHalf[i]))
		if res >= 3 or res == 1:
			isPalindromicTwist = False
		i += 1
	if isPalindromicTwist:
		print('YES')
	else:
		print('NO')
t = int(input())
i = 0
while i < t * 2:
	size = int(input())
	string = input()
	palindromicTwist(size, string)
	i += 2


def increment(c):
	return chr(ord(c) + 1)

def decrement(c):
	return chr(ord(c) - 1)

def isPalindromicTwist(n, s):
	left = 0
	right = n - 1
	while left <= right:
		if increment(s[left]) == increment(s[right]) or increment(s[left]) == decrement(s[right]) or decrement(s[left]) == decrement(s[right]) or (decrement(s[left]) == increment(s[right])):
			left += 1
			right -= 1
			continue
		return False
	return True
t = int(input().rstrip())
for _ in range(t):
	n = int(input().rstrip())
	s = input().rstrip()
	if isPalindromicTwist(n, s):
		print('YES')
	else:
		print('NO')


def check(a, b):
	for i in range(-1, 2):
		for j in range(-1, 2):
			if i != 0 and j != 0:
				if a + i == b + j:
					return True
	return False

def isReverse(s, i):
	if i >= len(s) - i - 1:
		return 'YES'
	if check(ord(s[i]), ord(s[len(s) - i - 1])):
		return isReverse(s, i + 1)
	else:
		return 'NO'
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	print(isReverse(s, 0))


t = int(input())
for i in range(t):
	k = int(input())
	s = input()
	p = 1
	i = 0
	while i <= k // 2 and p == 1:
		if ord(s[i]) == ord(s[len(s) - i - 1]) or abs(ord(s[i]) - ord(s[len(s) - i - 1])) == 2:
			i += 1
		else:
			p = 0
	if p == 1:
		print('YES')
	else:
		print('NO')


def check(s, n):
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - 1 - i])) == 2 or abs(ord(s[i]) - ord(s[n - 1 - i])) == 0:
			continue
		else:
			print('NO')
			return
	print('YES')
	return
for _ in range(int(input())):
	n = int(input())
	s = input()
	check(s, n)


alpha = 'abcdefghijklmnopqrstuvwxyz'

def cf(c):
	if c == 'z':
		return -1
	else:
		return alpha[alpha.index(c) + 1]

def cb(c):
	if c == 'a':
		return -2
	else:
		return alpha[alpha.index(c) - 1]
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	no = False
	while i < j:
		if cf(s[i]) == cf(s[j]) or cf(s[i]) == cb(s[j]) or cf(s[j]) == cb(s[i]) or (cb(s[j]) == cb(s[i])):
			i += 1
			j -= 1
			continue
		else:
			no = True
			break
		i += 1
		j -= 1
	print('NO' if no else 'YES')


for t in range(int(input())):
	n = int(input())
	s = input()
	l = 0
	r = n - 1
	isFound = 0
	while l < r:
		if abs(ord(s[l]) - ord(s[r])) not in (0, 2):
			isFound = 1
			break
		l += 1
		r -= 1
	print('NO' if isFound else 'YES')


def ret(a):
	if a == 'a':
		return ['b']
	elif a == 'z':
		return ['y']
	else:
		return [chr(ord(a) - 1), chr(ord(a) + 1)]

def analisar(a, b):
	for i in a:
		if i in b:
			return True
	return False
t = int(input())
while t > 0:
	n = int(input()) // 2
	string = input()
	p1 = string[:n]
	p2 = string[n:][::-1]
	testando = True
	i = 0
	while i < n:
		testando = testando and analisar(ret(p1[i]), ret(p2[i]))
		if not testando:
			break
		i += 1
	if testando:
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in [0] * int(input()):
	input()
	s = input()
	print(('NO', 'YES')[all((ord(x) - ord(y) in (-2, 0, 2) for (x, y) in zip(s, s[::-1])))])


num = int(input())
inputs = []
for i in range(num):
	n = int(input())
	s = input()
	inputs.append((n, s))

def eval(item):
	n = item[0]
	s = item[1]
	result = 'YES'
	for i in range(n // 2):
		temp = abs(ord(s[i]) - ord(s[n - i - 1]))
		if temp != 2 and temp != 0:
			result = 'NO'
			break
	return result
for i in range(num):
	print(eval(inputs[i]))


from sys import stdin, stdout
from collections import deque
T = int(stdin.readline())
for t in range(T):
	n = int(stdin.readline())
	s = stdin.readline().strip()
	label = 1
	for i in range(n):
		if abs(ord(s[i]) - ord(s[n - i - 1])) not in [0, 2]:
			label = 0
			break
	if label:
		stdout.write('YES\n')
	else:
		stdout.write('NO\n')


t = int(input())
for i in range(t):
	n = int(input())
	l = list(input())
	flag = 1
	for i in range(int(len(l) / 2)):
		if abs(ord(l[i]) - ord(l[n - 1 - i])) == 2 or abs(ord(l[i]) - ord(l[n - 1 - i])) == 0:
			flag = 0
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = True
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) not in (0, 2):
			ans = False
			break
	print('YES' if ans else 'NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	flag = True
	for i in range(n // 2):
		a = ord(s[i])
		b = ord(s[n - i - 1])
		if abs(a - b) != 2 and a != b:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


N = int(input())
for i in range(N):
	ans = True
	length = int(input())
	word = input()
	yoyuu = 0
	for j in range(length // 2):
		if abs(ord(word[j]) - ord(word[-(j + 1)])) != 0 and abs(ord(word[j]) - ord(word[-(j + 1)])) != 2:
			ans = False
	if ans:
		print('YES')
	else:
		print('NO')


def solve_single(line):
	(n, s) = line
	for i in range(n // 2):
		j = n - i - 1
		(a, b) = (s[i], s[j])
		if abs(ord(b) - ord(a)) not in (2, 0):
			return False
	return True

def solve(lines):
	return [solve_single(line) for line in lines]
T = int(input())
lines = ((int(input()), input()) for _ in range(T))
print('\n'.join(['YES' if result else 'NO' for result in solve(lines)]))


def solution(s, n):
	flag = True
	half = n // 2
	loc_ord = ord
	for i in range(half):
		d = abs(loc_ord(s[i]) - loc_ord(s[n - i - 1]))
		if d == 1 or d > 2:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	solution(s, n)


ALFANUM = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
EXEPT = 'az'

def process():
	sLen = int(input())
	mid = int(sLen / 2)
	last = sLen - 1
	s = input()
	for i in range(mid):
		ltL = s[i]
		ltR = s[last - i]
		if ltL in EXEPT and ltR == ltL:
			continue
		nsL = ALFANUM[ltL]
		nsR = ALFANUM[ltR]
		diff = abs(nsL - nsR)
		if diff > 2 or diff == 1:
			return 'NO'
	return 'YES'

def run():
	T = int(input())
	for _ in range(T):
		print(process())
run()


def next(c):
	if c == 'z':
		return 'y'
	return chr(ord(c) + 1)

def prev(c):
	if c == 'a':
		return 'b'
	return chr(ord(c) - 1)

def pal(string):
	for i in range(len(string) // 2):
		if string[i] == string[len(string) - i - 1] or next(string[i]) == prev(string[len(string) - i - 1]) or prev(string[i]) == next(string[len(string) - i - 1]):
			continue
		return False
	return True

def main():
	n = int(input())
	for i in range(n):
		input()
		string = input()
		print('YES' if pal(string) else 'NO')
main()


t = int(input())
for jj in range(t):
	n = int(input())
	a = str(input())
	sred = n // 2
	norm = True
	for i in range(sred):
		if abs(ord(a[i]) - ord(a[n - 1 - i])) != 2 and abs(ord(a[i]) - ord(a[n - 1 - i])) != 0:
			norm = False
			break
	if norm:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	n = int(input())
	s = input()
	f = True
	for i in range(n // 2):
		c = abs(ord(s[i]) - ord(s[n - i - 1]))
		if c != 0 and c != 2:
			f = False
			break
	if f:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = 'YES'
	for i in range(n):
		d = ord(s[i]) - ord(s[n - i - 1])
		if d == 0 or abs(d) == 2:
			continue
		else:
			ans = 'NO'
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	inp = input()
	no = False
	for i in range(n // 2):
		if abs(ord(inp[n - i - 1]) - ord(inp[i])) not in [0, 2]:
			no = True
			break
	print('YES' if no == False else 'NO')


from sys import stdin
t = int(stdin.readline())
for ti in range(t):
	n = int(stdin.readline())
	s = str(stdin.readline().strip())
	yes = True
	for p in range(n // 2):
		yes = abs(abs(ord(s[p]) - ord(s[n - 1 - p])) - 1) == 1
		if not yes:
			break
	print('YES' if yes else 'NO')


q = int(input().strip())
l = []
for i in range(q):
	flag = 0
	a = int(input().strip())
	b = str(input().strip())
	for j in range(a // 2):
		z = abs(ord(b[j]) - ord(b[a - 1 - j]))
		if z != 2 and z != 0:
			flag = 1
	if flag == 1:
		l.append('NO')
	else:
		l.append('YES')
for i in l:
	print(i)


T = int(input())
l = []
for i in range(T):
	a = input()
	l.append(input())
for j in l:
	ans = 'NO'
	for k in range(int(len(j) / 2)):
		if abs(ord(j[k]) - ord(j[-1 - k])) == 2 or abs(ord(j[k]) - ord(j[-1 - k])) == 0:
			ans = 'YES'
		else:
			ans = 'NO'
			break
	print(ans)


k = int(input())
for i in range(k):
	n = int(input())
	string = str(input())
	lst = list(string)
	lst_new = [ord(x) for x in lst]
	l = []
	for r in range(n):
		if abs(lst_new[r] - lst_new[n - r - 1]) == 2 or abs(lst_new[r] - lst_new[n - r - 1]) == 0:
			l.append(1)
		else:
			l.append(0)
	if 0 in l:
		print('NO')
	else:
		print('YES')
	k = k + 1


n = int(input())
for i in range(n):
	N = int(input())
	lst = list(input())
	ans = 0
	for j in range(N // 2):
		if abs(ord(lst[j]) - ord(lst[-j - 1])) == 2 or ord(lst[j]) - ord(lst[-j - 1]) == 0:
			ans += 1
	if ans == N // 2:
		print('YES')
	else:
		print('NO')
	ans = 0


a = 'abcdefghijklmnopqrstuvwxyz'
p = 0
t = int(input())
r = []
for jkjk in range(t):
	p = 0
	n = int(input())
	s = input()
	m = int(n / 2)
	for i in range(0, m):
		x = s[i]
		y = s[n - 1 - i]
		if abs(a.index(x) - a.index(y)) != 2 and x != y:
			p = 1
			r.append('NO')
			break
	if p == 0:
		r.append('YES')
for i in r:
	print(i)


import sys
import string

def main(testing=False):
	index = 0
	pos = {}
	for letter in string.ascii_lowercase:
		pos[letter] = index
		index = index + 1

	def cont(a, b):
		return abs(pos[a] - pos[b]) < 3 and abs(pos[a] - pos[b]) != 1

	def palinorder(string):
		for i in range(len(string) // 2):
			(a, b) = (string[i], string[-i - 1])
			if not cont(a, b):
				return 'NO'
		else:
			return 'YES'
	if not testing:
		requests = int(sys.stdin.readline())
		for i in range(requests):
			sys.stdin.readline()
			strRequest = sys.stdin.readline().strip()
			print(palinorder(strRequest))
main(testing=False)


num_of_test_cases = int(input())
for j in range(num_of_test_cases):
	my_str_length = int(input())
	my_str = [i for i in input()]
	num_of_passes = my_str_length // 2
	(beg, end) = (0, -1)
	palindrome_flag = True
	count = my_str_length // 2
	while num_of_passes > 0:
		allowed_diff = abs(ord(my_str[beg]) - ord(my_str[end]))
		if allowed_diff == 0 or allowed_diff == 2:
			palindrome_flag = True
			count -= 1
		else:
			palindrome_flag = False
		beg += 1
		end -= 1
		num_of_passes -= 1
	if not palindrome_flag:
		print('NO')
	elif palindrome_flag and count == 0:
		print('YES')
	elif palindrome_flag and count != 0:
		print('NO')


inputs = int(input())
answers = list()
for i in range(inputs):
	size = int(input())
	string = list(input())
	for j in range(size // 2):
		if string[j] == string[size - 1 - j]:
			continue
		elif ord(string[j]) + 1 == ord(string[size - 1 - j]) - 1:
			continue
		elif ord(string[j]) - 1 == ord(string[size - 1 - j]) + 1:
			continue
		else:
			answers.append('NO')
			break
	if len(answers) < i + 1:
		answers.append('YES')
print(*answers, sep='\n')


import string
t = int(input())
ans = []
alpha = list(string.ascii_lowercase)
for i in range(t):
	n = int(input())
	s = list(input())
	for i in range(int(n / 2)):
		x = alpha.index(s[i])
		y = alpha.index(s[n - i - 1])
		if x == y:
			flag = 0
		elif x + 1 == y - 1:
			flag = 0
		elif x - 1 == y + 1:
			flag = 0
		else:
			flag = 1
			break
	if flag == 1:
		ans.append('NO')
	else:
		ans.append('YES')
for i in range(t):
	print(ans[i])


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	f = 0
	for j in range(n // 2):
		f = 0
		a = ord(s[j])
		b = ord(s[n - j - 1])
		p = [a - 1, a + 1]
		q = [b - 1, b + 1]
		for v in p:
			if v in q:
				f = 1
				break
		if f == 0:
			print('NO')
			break
	if f == 1:
		print('YES')


n = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	x = int(input())
	s = input()
	mid = int(len(s) / 2)
	if s[:mid] == s[mid + 1:]:
		print('YES')
	else:
		a = 0
		for j in range(mid):
			if abs(ord(s[j]) - ord(s[-j - 1])) == 2 or abs(ord(s[j]) - ord(s[-j - 1])) == 0:
				a += 1
		if a == mid:
			print('YES')
		else:
			print('NO')


def answer(s, n):
	for i in range(n // 2):
		if not (s[i] == s[n - i - 1] or abs(ord(s[i]) - ord(s[n - i - 1])) == 2):
			print('NO')
			return
	print('YES')
	return
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	answer(s, n)


nbChaines = int(input())
for i in range(nbChaines):
	nbCaracteres = int(input())
	chaine = input()
	a = True
	for j in range(nbCaracteres // 2):
		if ord(chaine[j]) - 1 == ord(chaine[-1 - j]) + 1 or ord(chaine[j]) - 1 == ord(chaine[-1 - j]) - 1 or ord(chaine[j]) + 1 == ord(chaine[-1 - j]) - 1 or (ord(chaine[j]) + 1 == ord(chaine[-1 - j]) + 1):
			pass
		else:
			a = False
	if a:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	s = input()
	flag = 1
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) > 2 or abs(ord(s[i]) - ord(s[n - i - 1])) == 1:
			flag = 0
	if flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	j = int(input())
	s = input()
	for i in range(int(j / 2)):
		if abs(ord(s[i]) - ord(s[j - i - 1])) == 0 or abs(ord(s[i]) - ord(s[j - i - 1])) == 2:
			if i == j / 2 - 1:
				print('YES')
		else:
			print('NO')
			break


for _ in [0] * int(input()):
	flag = True
	input()
	s = input()
	for i in range(len(s) // 2):
		if abs(ord(s[i]) - ord(s[-i - 1])) > 2 or abs(ord(s[i]) - ord(s[-i - 1])) == 1:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	al = '-abcdefghijklmnopqrstuvwxyz'
	flag = 1
	while i < j:
		if s[i] == s[j]:
			i += 1
			j -= 1
		elif abs(al.index(s[i]) - al.index(s[j])) == 2:
			i += 1
			j -= 1
		else:
			flag = 0
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')


def isStringPalindrome(s):
	if len(s) > 0 and s == s[::-1]:
		return True
	return False
ans = 0

def solve(n, s, an, indx):
	if indx >= n:
		return an
	asci = ord(s[indx])
	f2 = f1 = ''
	if asci < 122:
		f1 = solve(n, s, an + chr(asci + 1), indx + 1)
	if asci > 97:
		f2 = solve(n, s, an + chr(asci - 1), indx + 1)
	if isStringPalindrome(str(f1)) or isStringPalindrome(str(f2)):
		global ans
		ans = 100

def run(n, s):
	ans = 'YES'
	for i in range(int(n / 2)):
		f1 = ord(s[i])
		f2 = ord(s[n - i - 1])
		flag = False
		if f1 < 122 and f2 < 122 and (f1 + 1 == f2 + 1):
			flag = True
		if f1 > 97 and f2 > 97 and (f1 - 1 == f2 - 1):
			flag = True
		if f1 < 122 and f2 > 97 and (f1 + 1 == f2 - 1):
			flag = True
		if f1 > 97 and f2 < 122 and (f1 - 1 == f2 + 1):
			flag = True
		if not flag:
			ans = 'NO'
			break
	print(ans)
t = int(input())
for i in range(t):
	ans = 0
	n = int(input())
	s = input()
	run(n, s)


def get_mask(inp):
	return 5 << ord(inp) - ord('a')
n = int(input())
for i in range(0, n):
	input()
	st = input()
	ls = []
	for j in st:
		ls.append(get_mask(j))
	for j in range(0, len(ls) // 2):
		if ls[j] & ls[-1 * (j + 1)] == 0:
			print('NO')
			break
	else:
		print('YES')


for _ in range(int(input())):
	(n, s) = (int(input()), input())
	for i in range(n // 2):
		if ord(s[i]) - ord(s[-i - 1]) not in (-2, 0, 2):
			print('NO')
			break
	else:
		print('YES')


def palindrome(s):
	if len(s) < 1:
		return True
	else:
		uniF = ord(s[0]) - 96
		uniL = ord(s[-1]) - 96
		if uniF == uniL or uniF - 1 == uniL + 1 or uniF + 1 == uniL - 1:
			return palindrome(s[1:-1])
		else:
			return False
n = int(input())
resp = []
for i in range(n):
	l = int(input())
	s = input()
	if palindrome(s) == True:
		resp.append('YES')
	else:
		resp.append('NO')
for i in range(n):
	print(resp[i])


for _ in range(int(input())):
	n = int(input())
	s = input()
	for i in range(1, n // 2 + 1):
		a = ord(s[i - 1])
		b = ord(s[-1 * i])
		if abs(a - b) == 0 or abs(a - b) == 2:
			pass
		else:
			print('NO')
			break
	else:
		print('YES')


addr1 = 'C:\\Users\\admin\\Desktop\\python_in.txt'
addr2 = 'C:\\Users\\admin\\Desktop\\python_out.txt'
T = int(input())
while T > 0:
	T -= 1
	n = int(input())
	s = input()
	ans = 1
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - 1 - i])) != 2 and s[i] != s[n - 1 - i]:
			ans = 0
			break
	if ans == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = str(input())
	s_rev = s[::-1]
	first = ''
	last = ''
	for i in range(len(s) // 2):
		first += s[i]
	for i in range(len(s) // 2):
		last += s_rev[i]
	flag = 0
	for i in range(len(first)):
		if abs(ord(first[i]) - ord(last[i])) > 2 or abs(ord(first[i]) - ord(last[i])) == 1:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')


from sys import stdin

def test(s_):
	ord_ = list(map(ord, s_))[:-1]
	delta = [abs(ord_[i] - ord_[-1 - i]) for i in range(len(s_) // 2)]
	return not any(map(lambda x: x not in {0, 2}, delta))

def get_ans(s_):
	return ('NO', 'YES')[test(s_)]
ans = list(map(get_ans, stdin.readlines()[2::2]))
print('\n'.join(ans))


al = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
for i in range(n):
	t = int(input())
	s = input()
	p = s[:t // 2]
	q = s[t // 2:]
	q = q[::-1]
	flag = True
	for j in range(t // 2):
		pi = ord(p[j]) - ord('a')
		qi = ord(q[j]) - ord('a')
		recp = set()
		recq = set()
		if pi != 0 and pi != 25:
			recp.add(al[pi - 1])
			recp.add(al[pi + 1])
		elif pi == 0:
			recp.add(al[pi + 1])
		else:
			recp.add(al[pi - 1])
		if qi != 0 and qi != 25:
			recq.add(al[qi - 1])
			recq.add(al[qi + 1])
		elif qi == 0:
			recq.add(al[qi + 1])
		else:
			recq.add(al[qi - 1])
		if len(recp & recq) == 0:
			flag = False
	if flag:
		print('YES')
	else:
		print('NO')


from string import ascii_lowercase
a = ascii_lowercase
t = int(input())

def get_neis(char):
	if char == 'a':
		return {'b'}
	if char == 'z':
		return {'y'}
	index = a.index(char)
	return {a[index - 1], a[index + 1]}
ans = list()
for _ in range(t):
	n = int(input())
	s = input()
	res = 'YES'
	for i in range(n // 2):
		if not get_neis(s[i]) & get_neis(s[n - i - 1]):
			res = 'NO'
			break
	ans.append(res)
for a in ans:
	print(a)


for test_case in range(int(input())):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	mid = n // 2 - 1
	check = True
	while i <= mid and j >= n // 2:
		a = ord(s[i])
		b = ord(s[j])
		if a - 1 == b - 1 or a + 1 == b + 1 or a - 1 == b + 1 or (a + 1 == b - 1):
			check = True
		else:
			check = False
			break
		i += 1
		j -= 1
	if check:
		print('YES')
	else:
		print('NO')


t = int(input().strip())
for _ in range(t):
	ans = 'YES'
	n = int(input().strip())
	s = input().strip()
	for i in range(int(len(s) / 2)):
		if abs(ord(s[i]) - ord(s[-i - 1])) > 2 or abs(ord(s[i]) - ord(s[-i - 1])) == 1:
			ans = 'NO'
			break
	print(ans)


Letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for i in range(t):
	l = int(input())
	a = list(input())
	for i in range(l // 2):
		k = Letters.index(a[i])
		j = Letters.index(a[-i - 1])
		if 0 < k < 25 and 0 < j < 25:
			if Letters[k - 1] != Letters[j - 1] and Letters[k + 1] != Letters[j - 1] and (Letters[k - 1] != Letters[j + 1]) and (Letters[k + 1] != Letters[j + 1]):
				print('NO')
				break
		elif k == 0 and 0 < j < 25:
			if Letters[k + 1] != Letters[j - 1] and Letters[k + 1] != Letters[j + 1]:
				print('NO')
				break
		elif k == 0 and j == 25:
			if Letters[k + 1] != Letters[j - 1]:
				print('NO')
				break
		elif k == 25 and 0 < j < 25:
			if Letters[k - 1] != Letters[j - 1] and Letters[k - 1] != Letters[j + 1]:
				print('NO')
				break
		elif k == 25 and j == 0:
			if Letters[k - 1] != Letters[j + 1]:
				print('NO')
				break
		elif 0 < k < 25 and j == 0:
			if Letters[k - 1] != Letters[j + 1] and Letters[k + 1] != Letters[j + 1]:
				print('NO')
				break
		elif 0 < k < 25 and j == 25:
			if Letters[k - 1] != Letters[j - 1] and Letters[k + 1] != Letters[j - 1]:
				print('NO')
				break
		if i == l // 2 - 1:
			print('YES')


import math

def test(a, b):
	if a == b:
		return True
	else:
		return abs(ord(a) - ord(b)) == 2

def check(a):
	b = a[::-1]
	return all([test(x, y) for (x, y) in zip(a, b)])
i = int(input())
for x in range(i):
	u = input()
	p = input()
	if check(p):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	a = int(input())
	s = input()
	s1 = s[::-1]
	c = 0
	for i in range(a // 2):
		if abs(ord(s[i]) - ord(s1[i])) in [0, 2]:
			c += 1
	if c == a // 2:
		print('YES')
	else:
		print('NO')


N = int(input())
for _ in range(N):
	ans = 'YES'
	T = int(input())
	S = input()
	S1 = list(S[:T // 2])
	S2 = list(S[T // 2:])
	S2 = S2[::-1]
	U1 = list(map(ord, S1))
	U2 = list(map(ord, S2))
	for i in range(T // 2):
		if U1[i] == U2[i] or abs(U1[i] - U2[i]) == 2:
			pass
		else:
			ans = 'NO'
			break
	print(ans)


dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}
t = input()
t = int(t)
for i in range(t):
	r = input()
	s = input()
	n = int(r)
	l = n // 2
	count = 0
	for i in range(l):
		if dict[s[i]] - dict[s[n - i - 1]] == 0 or dict[s[i]] - dict[s[n - i - 1]] == 2 or dict[s[i]] - dict[s[n - i - 1]] == -2:
			count += 1
		else:
			count = -1
			break
	if count == l:
		print('YES')
	else:
		print('NO')


from string import ascii_lowercase
letras = list(ascii_lowercase)
n = int(input())
saida = []
for _ in range(n):
	l = int(input())
	s = list(input())
	for il in range(int(len(s) / 2)):
		if letras.index(s[il]) == letras.index(s[-il - 1]):
			continue
		if letras.index(s[il]) + 2 == letras.index(s[-il - 1]) or letras.index(s[il]) - 2 == letras.index(s[-il - 1]):
			continue
		saida.append('NO')
		break
	else:
		saida.append('YES')
print('\n'.join(saida))


t = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
for q in range(t):
	n = int(input())
	s = list(input())
	i = 0
	j = n - 1
	ans = 'YES'
	while i < j and ans != 'NO':
		a = set()
		b = set()
		if s[i] != s[j]:
			if s[i] != 'a':
				a.add(alph.find(s[i]) - 1)
			if s[i] != 'z':
				a.add(alph.find(s[i]) + 1)
			if s[j] != 'a':
				b.add(alph.find(s[j]) - 1)
			if s[j] != 'z':
				b.add(alph.find(s[j]) + 1)
			a &= b
			if len(a) == 0:
				ans = 'NO'
		i += 1
		j -= 1
	print(ans)


for _ in range(int(input())):
	N = int(input())
	s = input()
	l = list(s)
	for i in range(0, N):
		k = abs(ord(s[i]) - ord(s[N - i - 1]))
		if k > 2 or k % 2 == 1:
			print('NO')
			break
	else:
		print('YES')


t = int(input())
c = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	n = int(input())
	s = input()
	k = n // 2
	for j in range(k):
		a = c.index(s[j])
		b = c.index(s[n - 1 - j])
		x = [a - 1, a + 1]
		y = [b - 1, b + 1]
		if a == 0:
			x = [1]
		elif a == 25:
			x = [24]
		if b == 0:
			y = [1]
		elif b == 25:
			y = [24]
		common = 0
		for f in x:
			if f in y:
				common += 1
		if common == 0:
			print('NO')
			break
	else:
		print('YES')


def verify(a, b):
	ta = []
	tb = []
	if a < 'z':
		ta.append(chr(ord(a) + 1))
	if a > 'a':
		ta.append(chr(ord(a) - 1))
	if b < 'z':
		tb.append(chr(ord(b) + 1))
	if b > 'a':
		tb.append(chr(ord(b) - 1))
	if len(ta) == 1:
		if ta[0] in tb:
			return True
		else:
			return False
	elif ta[0] in tb or ta[1] in tb:
		return True
	else:
		return False
tc = int(input())
while tc > 0:
	input()
	s = input()
	l = 0
	r = len(s) - 1
	work = True
	while l < r:
		if s[l] != s[r]:
			if not verify(s[l], s[r]):
				work = False
				break
		l += 1
		r -= 1
	if work:
		print('YES')
	else:
		print('NO')
	tc -= 1


t = int(input())
for x in range(t):
	n = int(input())
	s = str(input())
	p = 'YES'
	for i in range(n // 2):
		d = abs(ord(s[i]) - ord(s[n - i - 1]))
		if d > 2 or d == 1:
			p = 'NO'
			break
	print(p)


q = int(input())
for x in range(q):
	n = int(input())
	s = str(input())
	f = False
	for x in range(n // 2):
		if abs(ord(s[x]) - ord(s[n - x - 1])) > 2 or abs(ord(s[x]) - ord(s[n - x - 1])) == 1:
			f = True
			break
	if f:
		print('NO')
	else:
		print('YES')


def is_pal(s):
	for i in range(len(s) // 2):
		dif = abs(ord(s[i]) - ord(s[-i - 1]))
		if dif != 0 and dif != 2:
			return False
	return True
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	buf = []
	print('YES' if is_pal(s) else 'NO')


t = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
letter_map = dict(zip(letters, range(26)))

def is_pal(tmp):
	for j in range(len(tmp) // 2):
		if abs(tmp[j] - tmp[-j - 1]) != 0 and abs(tmp[j] - tmp[-j - 1]) != 2:
			return 'NO'
	return 'YES'
for i in range(t):
	n = int(input())
	s = input()
	z = [letter_map[i] for i in s]
	print(is_pal(z))


num = int(input())
for i in range(num):
	flag = 1
	length = int(input())
	string = input()
	for j in range(int(length / 2)):
		if string[j] == 'a':
			if string[length - 1 - j] == 'a' or string[length - 1 - j] == 'c':
				continue
			else:
				flag = 0
				print('NO')
				break
		elif string[j] == 'z':
			if string[length - 1 - j] == 'z' or string[length - 1 - j] == 'x':
				continue
			else:
				flag = 0
				print('NO')
				break
		elif abs(ord(string[length - 1 - j]) - ord(string[j])) == 2 or string[j] == string[length - 1 - j]:
			continue
		else:
			flag = 0
			print('NO')
			break
	if flag == 1:
		print('YES')


s = '1abcdefghijklmnopqrstuvwxyz2'

def check(x, y):
	if s[s.index(x) - 1] == s[s.index(y) + 1] or s[s.index(x) - 1] == s[s.index(y) - 1] or s[s.index(x) + 1] == s[s.index(y) - 1] or (s[s.index(x) + 1] == s[s.index(y) + 1]):
		return 1
	else:
		return 0
q = int(input())
for i in range(q):
	n = int(input()) // 2
	s1 = input()
	r = 1
	f = s1[:n]
	m = s1[n:][::-1]
	for j in range(n):
		if f[j] != m[j]:
			if not check(f[j], m[j]):
				r = 0
				print('NO')
				break
	if r:
		print('YES')


import math
n = int(input())
for i in range(n):
	m = int(input())
	s = input()
	(s1, s2) = ('', '')
	for j in range(m):
		if j < m / 2:
			s1 = s1 + s[j]
		else:
			s2 = s[j] + s2
	b = True
	for j in range(math.floor(m / 2)):
		if ord(s1[j]) == ord(s2[j]) or abs(ord(s1[j]) - ord(s2[j])) == 2:
			continue
		else:
			b = False
	if b:
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(range(ord('a'), ord('z') + 1))
for i in range(t):
	n = int(input())
	s = input()
	co = 0
	for i in range(n // 2):
		b = []
		c = []
		l = ord(s[i])
		m = ord(s[-i - 1])
		if l - 1 in a:
			b.append(l - 1)
		if l + 1 in a:
			b.append(l + 1)
		if m - 1 in a:
			c.append(m - 1)
		if m + 1 in a:
			c.append(m + 1)
		fl = 0
		for j in b:
			if j in c:
				fl = 1
		if fl:
			co += 1
	if co == n // 2:
		print('YES')
	else:
		print('NO')


n = int(input())
for h in range(n):
	m = int(input())
	x = input()
	ji = 0
	for i in range(m):
		if x[i] != x[m - 1 - i] and abs(ord(x[i]) - ord(x[m - 1 - i])) != 2:
			ji = 1
			break
	print('NO' if ji else 'YES')


I = lambda : map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	s = input()
	for i in range(n // 2):
		if s[i] != 'a' or s[i] != 'z':
			if chr(ord(s[i]) + 1) != chr(ord(s[-i - 1]) + 1) and chr(ord(s[i]) + 1) != chr(ord(s[-i - 1]) - 1) and (chr(ord(s[i]) - 1) != chr(ord(s[-i - 1]) + 1)) and (chr(ord(s[i]) - 1) != chr(ord(s[-i - 1]) - 1)):
				print('NO')
				break
		elif s[i] == 'a' and s[-i - 1] != 'z':
			if chr(ord(s[i]) + 1) != chr(ord(s[-i - 1]) + 1) and chr(ord(s[i]) + 1) != chr(ord(s[-i - 1]) - 1):
				print('NO')
				break
		elif s[i] == 'z' and s[-i - 1] != 'a':
			if chr(ord(s[i]) - 1) != chr(ord(s[-i - 1]) + 1) and chr(ord(s[i]) - 1) != chr(ord(s[-i - 1]) - 1):
				print('NO')
				break
		else:
			print('NO')
			break
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	flag = True
	for i in range(len(s) // 2):
		if s[i] == s[n - i - 1]:
			continue
		elif abs(ord(s[i]) - ord(s[n - i - 1])) % 26 == 2:
			continue
		else:
			flag = False
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	s1 = s[0:n // 2]
	s2 = ''
	c = n // 2
	for j in range(n - 1, c - 1, -1):
		s2 = s2 + s[j]
	d = 0
	for j in range(c):
		if s1[j] == s2[j]:
			d += 1
		if abs(ord(s1[j]) - ord(s2[j])) == 2:
			d += 1
	if d == c:
		print('YES')
	else:
		print('NO')


p = lambda : input()
for _ in ' ' * int(p()):
	a = int(p())
	z = p()
	print('YNEOS'[any((abs(ord(z[i]) - ord(z[a - i - 1])) not in [0, 2] for i in range(a // 2)))::2])


t = int(input())
while t:
	t = t - 1
	n = int(input())
	s = input()
	c = 0
	for i in range(n // 2):
		p = abs(ord(s[i]) - ord(s[n - 1 - i]))
		if s[i] == s[n - 1 - i]:
			c = c + 1
		elif p == 2:
			c = c + 1
	if c == n / 2:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	s = input()
	(i, j) = (0, n - 1)
	f = 1
	while i < n // 2:
		temp = abs(ord(s[i]) - ord(s[j]))
		if temp == 0 or temp == 2:
			i += 1
			j -= 1
		else:
			f = 0
			print('NO')
			break
	if f == 1:
		print('YES')


a = map(chr, range(97, 123))
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	s = input()
	li = []
	for ch in s:
		if ch == 'a':
			li.append('b')
		elif ch == 'z':
			li.append('y')
		else:
			b = ord(ch)
			(x, y) = (chr(b - 1), chr(b + 1))
			li.append((x, y))
	cnt = 0
	for i in range(n // 2):
		d = li[n - i - 1]
		if type(li[i]) is str:
			if type(d) is str:
				if li[i] == d:
					cnt += 1
			elif li[i] == d[0] or li[i] == d[1]:
				cnt += 1
		elif type(d) is str:
			if li[i][0] == d or li[i][1] == d:
				cnt += 1
		elif len(set(li[i]).intersection(set(d))) > 0:
			cnt += 1
	if cnt == n // 2:
		print('YES')
	else:
		print('NO')


import atexit
import io
import sys
from bisect import *
from collections import *
from fractions import gcd
from itertools import *
from math import *
import os
inf = float('inf')
_inf = float('-inf')
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def main():
	i = int(input())
	for _ in range(i):
		ii = int(input())
		s = input()
		c = 0
		for j in range(len(s) // 2):
			temp = abs(ord(s[j]) - ord(s[ii - j - 1]))
			if temp == 2 or temp == 0:
				continue
			else:
				c += 1
		if c == 0:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
q = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	n = int(input())
	a = input()
	for i in range(int(n / 2)):
		if abs(q.index(a[i]) - q.index(a[n - i - 1])) > 2 or abs(q.index(a[i]) - q.index(a[n - i - 1])) == 1:
			print('NO')
			break
	else:
		print('YES')


import sys
readline = sys.stdin.readline

def calc(a, b):
	if a + 1 == b + 1:
		return True
	if a - 1 == b + 1:
		return True
	if a + 1 == b - 1:
		return True
	if a - 1 == b - 1:
		return True
	return False
T = int(readline())
for _ in range(T):
	N = int(readline())
	S = list(map(lambda x: ord(x) - 97, readline().strip()))
	print('YES' if all((calc(S[i], S[N - i - 1]) for i in range(N // 2))) else 'NO')


def f(s):
	start = 0
	end = len(s) - 1
	while start < end:
		if abs(ord(s[start]) - ord(s[end])) != 2 and ord(s[start]) != ord(s[end]):
			print('NO')
			return
		start += 1
		end -= 1
	print('YES')
	return
m = int(input())
for i in range(m):
	input()
	f(input())


def get_code_list(code):
	if code == 97:
		return set([98])
	elif code == 122:
		return set([121])
	else:
		return set([code - 1, code + 1])
n = int(input())
for _ in range(n):
	t = int(input())
	string = input()
	can_be_palindrome = True
	for i in range(t // 2):
		first = ord(string[i])
		last = ord(string[t - 1 - i])
		first_list = get_code_list(first)
		last_list = get_code_list(last)
		found = False
		for num in first_list:
			if num in last_list:
				found = True
				break
		if not found:
			can_be_palindrome = False
			break
	if can_be_palindrome:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	n = int(input())
	s = input()
	c = 0
	p = n // 2
	for i in range(p):
		if ord(s[i]) == ord(s[n - i - 1]):
			c += 1
		elif ord(s[i]) + 1 == ord(s[n - i - 1]) - 1 or ord(s[i]) - 1 == ord(s[n - i - 1]) + 1:
			c += 1
	if c == p:
		print('YES')
	else:
		print('NO')


def readNums(type=int):
	inp = input().split()
	return list(map(type, inp)) if len(inp) > 1 else type(inp[0])

def solve(s, n):
	if n < 2:
		return True
	(l, r) = (0, n - 1)
	while l < r:
		if s[l] != s[r] and abs(ord(s[l]) - ord(s[r])) != 2:
			return False
		l += 1
		r -= 1
	return True
t = readNums()
for _ in range(t):
	n = readNums()
	s = input()
	print('YES' if solve(s, n) else 'NO')


T = int(input())
for a in range(T):
	n = int(input())
	s = input()
	i = -1
	j = n
	flag = 0
	while i < j:
		i += 1
		j -= 1
		if abs(ord(s[i]) - ord(s[j])) == 2 or abs(ord(s[i]) - ord(s[j])) == 0:
			continue
		else:
			flag = 1
	if flag == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	ans = True
	for j in range(n // 2):
		a = ord(s[j])
		b = ord(s[-j - 1])
		if abs(b - a) > 2 or abs(b - a) == 1:
			ans = False
			break
	if ans:
		print('YES')
	else:
		print('NO')


n = int(input())
v = []
for i in range(n):
	k = input()
	vv = input()
	v.append(vv)

def pal(a):
	alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	a = list(a)
	a1 = a[0:len(a) // 2]
	if len(a) % 2 == 0:
		a2 = a[len(a) // 2:len(a)]
	else:
		a2 = a[len(a) // 2 + 1:len(a)]
	a2.reverse()
	m1 = []
	m2 = []
	for i in range(len(a2)):
		if a1[i] == 'a':
			m1.append(['b'])
			continue
		if a1[i] == 'z':
			m1.append(['y'])
			continue
		s1 = alph.index(a1[i])
		m1.append([alph[s1 + 1], alph[s1 - 1]])
	for i in range(len(a2)):
		if a2[i] == 'a':
			m2.append(['b'])
			continue
		if a2[i] == 'z':
			m2.append(['y'])
			continue
		s2 = alph.index(a2[i])
		m2.append([alph[s2 + 1], alph[s2 - 1]])
	s = 0
	for i in range(len(m1)):
		for j in range(len(m1[i])):
			if m1[i][j] in m2[i]:
				s += 1
				break
	if s == len(m1):
		return 'YES'
	else:
		return 'NO'
for i in range(n):
	print(pal(v[i]))


gi = lambda : list(map(int, input().split()))
alph = '_abcdefghijklmnopqrstuvwxyz-'

def neigh(c):
	return [alph[alph.index(c) + 1], alph[alph.index(c) - 1]]
for k in range(gi()[0]):
	n = gi()[0]
	s = input()
	flag = True
	for j in range(n // 2):
		if s[j] == s[-j - 1]:
			pass
		elif alph[alph.index(s[-j - 1]) + 1] not in neigh(s[j]) and alph[alph.index(s[-j - 1]) - 1] not in neigh(s[j]):
			print('NO')
			flag = False
			break
	if flag:
		print('YES')


n = int(input())
tt = [-2, 0, 2]
for jj in range(n):
	(i, inp) = (input(), input())
	need = 1
	for j in range(len(inp)):
		if ord(inp[j]) - ord(inp[len(inp) - j - 1]) not in tt:
			need = 0
	if need:
		print('YES')
	else:
		print('NO')


t = int(input())
flag = True
a = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	n = int(input())
	s = list(input())
	for j in range(n // 2):
		if abs(a.index(s[j]) - a.index(s[-j - 1])) == 0 or abs(a.index(s[j]) - a.index(s[-j - 1])) == 2:
			continue
		else:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')
	else:
		flag = True


n = int(input())
for i in range(n):
	k = int(input())
	s = input()
	flag = True
	for j in range(k // 2):
		z = abs(ord(s[j]) - ord(s[len(s) - j - 1]))
		if z > 2 or z == 1:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	inp = input()
	if inp == inp[::-1]:
		print('YES')
	else:
		for i in range(n):
			if ord(inp[n - i - 1]) - 2 == ord(inp[i]) or ord(inp[i]) == ord(inp[n - i - 1]) or ord(inp[n - i - 1]) + 2 == ord(inp[i]):
				f = 0
			else:
				print('NO')
				f = 1
				break
		if f == 0:
			print('YES')


T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	check = True
	for i in range(n):
		if s[i] == 'a' or s[i] == 'A':
			st = {ord(s[i]) + 1}
		elif s[i] == 'z' or s[i] == 'Z':
			st = {ord(s[i]) - 1}
		else:
			st = {ord(s[i]) + 1, ord(s[i]) - 1}
		if s[n - 1 - i] == 'a' or s[n - 1 - i] == 'A':
			if ord(s[n - 1 - i]) + 1 not in st:
				check = False
				break
		elif s[n - 1 - i] == 'z' or s[n - 1 - i] == 'Z':
			if ord(s[n - 1 - i]) - 1 not in st:
				check = False
				break
		elif ord(s[n - 1 - i]) - 1 not in st and ord(s[n - 1 - i]) + 1 not in st:
			check = False
			break
	print('YES' if check else 'NO')


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	l = len(s) - 1
	for i in range(len(s)):
		if s[i] == s[l]:
			l = l - 1
			if i == len(s) - 1:
				print('YES')
				break
			continue
		if abs(ord(s[i]) - ord(s[l])) != 2:
			print('NO')
			break
		elif i == len(s) - 1:
			print('YES')
			break
		l = l - 1


import math

def canBeTheSame(char1, char2):
	diff = abs(ord(char1) - ord(char2))
	return diff == 0 or diff == 2

def canBePalindrome(s, n):
	for i in range(math.floor(n / 2)):
		if canBeTheSame(s[i], s[n - 1 - i]) == False:
			return 'NO'
	return 'YES'
T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	print(canBePalindrome(s, n))


t = int(input())
n = []
s = []
for i in range(t):
	n.append(int(input()))
	s.append(input())
for i in range(t):
	p = 0
	word = s[i]
	while p < n[i] // 2 and (abs(ord(word[p]) - ord(word[-(p + 1)])) == 2 or abs(ord(word[p]) - ord(word[-(p + 1)])) == 0):
		p += 1
	if p == n[i] // 2:
		print('YES')
	else:
		print('NO')


def checkpalin(n, str):
	palin = True
	for i in range(n // 2):
		if str[i] != str[n - 1 - i]:
			palin = False
	if palin:
		return True
	else:
		return False

def func(n, str):
	res = True
	for i in range(n // 2):
		if abs(ord(str[i]) - ord(str[n - 1 - i])) == 1 or abs(ord(str[i]) - ord(str[n - 1 - i])) > 2:
			return False
	return res
t = int(input())
while t > 0:
	n = int(input())
	str = list(input())
	if checkpalin(n, str):
		print('YES')
	elif func(n, str):
		print('YES')
	else:
		print('NO')
	t -= 1


def canBePalindrome(s, n):
	s = [ord(x) - ord('a') for x in s]
	for i in range(n // 2):
		a = s[i]
		b = s[n - i - 1]
		c = (max(a, b) - min(a, b)) % 26
		if c != 0 and c != 2:
			return False
	return True

def main():
	T = int(input())
	for t in range(T):
		n = int(input())
		s = list(input().strip())
		if canBePalindrome(s, n):
			print('YES')
		else:
			print('NO')
main()


def ispalindrome(i):
	l = list(i)
	if l == l[::-1]:
		return 1
	p = [-2, 0, 2]
	flag = 1
	for i in range(int(len(l) / 2)):
		if ord(l[i]) - ord(l[len(l) - i - 1]) not in p:
			flag = 0
			break
	return flag
t = int(input())
s = []
for i in range(t):
	n = int(input())
	s.append(input())
for i in s:
	if ispalindrome(i):
		print('YES')
	else:
		print('NO')


import string
az = string.ascii_lowercase
az_dict = {x: i for (i, x) in enumerate(az)}

def solve(m, r):
	for i in range(m // 2):
		if az_dict[r[i]] - az_dict[r[m - 1 - i]] not in [-2, 0, 2]:
			return False
	return True
t = int(input())
for case in range(t):
	n = int(input())
	s = input()
	if solve(n, s):
		print('YES')
	else:
		print('NO')


def mi():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	a = list(input())
	flag = 0
	for i in range(n // 2):
		c1 = ord(a[i])
		c2 = ord(a[n - 1 - i])
		if c1 - 1 == c2 - 1 or c1 - 1 == c2 + 1 or c1 + 1 == c2 - 1 or (c1 + 1 == c2 + 1):
			flag = 0
		else:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	m = int(input())
	l = m - 1
	s = input()
	flag = True
	for j in range(m // 2):
		if s[j] == s[l - j]:
			continue
		if abs(ord(s[j]) - ord(s[l - j])) == 2:
			continue
		else:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	s = input()
	res = True
	for i in range(n // 2):
		if ord(s[i]) == 'a' and ord(s[-1 - i]) == 'z':
			res = False
			break
		else:
			m = abs(ord(s[i]) - ord(s[-1 - i]))
			if m != 2 and m != 0:
				res = False
				break
	print('YES' if res else 'NO')


n = int(input())

def test():
	l: int = int(input())
	s = input()
	for i in range(0, l // 2):
		c1 = s[i]
		c2 = s[l - i - 1]
		if not (c1 == c2 or abs(ord(c2) - ord(c1)) == 2):
			return False
	return True
for i in range(n):
	if test():
		print('YES')
	else:
		print('NO')


def is_palindromic(mystr):
	l = len(mystr)
	for i in range(l):
		dist = abs(ord(mystr[i]) - ord(mystr[l - i - 1]))
		if dist > 2 or dist % 2 == 1:
			return False
	return True
x = int(input())
for i in range(x):
	tp = int(input())
	if is_palindromic(str(input())):
		print('YES')
	else:
		print('NO')


a = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for i in range(T):
	boolean = True
	n = int(input())
	s = input()
	for j in range(n):
		if s[j] != s[-j - 1] and abs(a.index(s[j]) - a.index(s[-j - 1])) != 2:
			boolean = False
	print('YES' if boolean else 'NO')


for i in range(int(input())):
	(n, s, f) = (int(input()), input(), 1)
	for j in range(n):
		if abs(ord(s[j]) - ord(s[n - j - 1])) not in [0, 2]:
			f = 0
			break
	print('NO' if f == 0 else 'YES')


import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
t = int(input())
for case in range(t):
	n = int(input())
	s = input()
	ok = 0
	for i in range(n // 2):
		dif = s[i] - s[n - 1 - i]
		if dif == 0 or abs(dif) == 2:
			ok += 1
		else:
			break
	if ok == n // 2:
		print('YES')
	else:
		print('NO')


import sys
T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	(l, r) = (0, n - 1)
	out = False
	while r > l:
		t = abs(ord(s[r]) - ord(s[l]))
		if t != 0 and t != 2:
			print('NO')
			out = True
			break
		l += 1
		r -= 1
	if not out:
		print('YES')


import sys, math
a = int(input())
for _ in range(a):
	n = int(input())
	s = input()
	br = 1
	for i in range(n // 2):
		if ord(s[i]) - ord(s[n - i - 1]) not in [-2, 0, 2]:
			print('NO')
			br = 0
			break
	if br == 0:
		continue
	else:
		print('YES')


for I in range(int(input())):
	input()
	s = input()
	n = len(s)
	for j in range(n // 2):
		k = ord(s[j]) - ord(s[n - 1])
		if k != -2 and k != 2 and (k != 0):
			print('NO')
			j = -1
			break
		n -= 1
	if j != -1:
		print('YES')


alfa = 'abcdefghijklmnopqrstuvwxyz'
d = {}
for (i, x) in enumerate(alfa):
	d[x] = i
for _ in range(int(input())):
	n = int(input())
	s = input()
	k = 'YES'
	for i in range(n // 2):
		item = abs(d[s[i]] - d[s[n - i - 1]])
		if item != 0 and item != 2:
			k = 'NO'
			break
	print(k)


for i in range(int(input())):
	input()
	s = input()
	print('NO' if sum([abs(abs(abs(ord(a) - ord(b)) - 1) - 1) for (a, b) in zip(s, s[::-1])]) else 'YES')


import filecmp
import sys
FILE_IO = False
if FILE_IO:
	input_stream = open('input_test.txt')
	sys.stdout = open('current_output.txt', 'w')
else:
	input_stream = sys.stdin
t = int(input_stream.readline().split()[0])
for _ in range(t):
	s_length = int(input_stream.readline())
	s = input_stream.readline()
	l = 0
	r = s_length - 1
	palindrom = True
	while l < r:
		distance = abs(ord(s[l]) - ord(s[r]))
		if distance > 2 or distance == 1:
			palindrom = False
			break
		l += 1
		r -= 1
	if palindrom:
		print('YES')
	else:
		print('NO')
if FILE_IO:
	assert filecmp.cmp('current_output.txt', 'expected_output.txt', shallow=False) == True


cases = int(input())
for case in range(cases):
	n = int(input())
	s = list(input())
	can = True
	for i in range(n // 2 + 1):
		if not (ord(s[i]) + 1 == ord(s[n - 1 - i]) - 1 or ord(s[i]) - 1 == ord(s[n - 1 - i]) + 1 or ord(s[i]) == ord(s[n - 1 - i])):
			can = False
			break
	if can:
		print('YES')
	else:
		print('NO')


from math import ceil as c
n = int(input())
for i in range(n):
	k = int(input())
	s = list(map(ord, input()))
	l = c(k / 2)
	for i in range(l):
		if s[i] == s[k - 1 - i] or abs(s[i] - s[k - 1 - i]) == 2:
			flag = 0
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
	else:
		print('NO')


def valid(a, b):
	d = abs(ord(a) - ord(b))
	return d == 0 or d == 2
T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	val = all((valid(s[i], s[n - i - 1]) for i in range(n)))
	print('YES' if val else 'NO')


def test_1():
	import math
	from collections import Counter
	n = list(map(int, input().split(' ')))[0]
	for i in range(n):
		m = list(map(int, input().split(' ')))[0]
		data = input().strip()
		flag = 1
		for i_1 in range(m):
			if abs(ord(data[i_1]) - ord(data[m - 1 - i_1])) != 2 and data[i_1] != data[m - 1 - i_1]:
				flag = 0
		if flag == 1:
			print('YES')
		else:
			print('NO')
test_1()


from sys import stdin
from math import *
line = stdin.readline().rstrip().split()
T = int(line[0])
for i in range(T):
	line = stdin.readline().rstrip().split()
	n = int(line[0])
	s = stdin.readline().rstrip().split()[0]
	isPal = True
	for j in range(len(s)):
		dif = ord(s[j]) - ord(s[n - 1 - j])
		if dif != 0 and dif != -2 and (dif != 2):
			isPal = False
			break
	if isPal:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	f = True
	for i in range(n // 2):
		a = s[i]
		b = s[n - i - 1]
		if a == b:
			continue
		else:
			a2 = ord(a) + 1
			a1 = ord(a) - 1
			b2 = ord(b) + 1
			b1 = ord(b) - 1
			if a1 == b2 or a2 == b1:
				continue
			else:
				f = False
				break
	if f == True:
		print('YES')
	else:
		print('NO')


def read_int():
	return [int(v) for v in input().split()]
h = {'a': set('b'), 'z': set('y')}
for i in range(24):
	h[chr(ord('a') + i + 1)] = {chr(ord('a') + i), chr(ord('a') + i + 2)}

def check(s):
	n = len(s)
	for i in range(n // 2):
		if not h[s[i]].intersection(h[s[n - i - 1]]):
			return False
	return True

def main():
	t = read_int()[0]
	for i in range(t):
		read_int()
		s = input()
		if check(s):
			print('YES')
		else:
			print('NO')
main()


import string
low_case = string.ascii_lowercase
A = []
n = int(input())
for x in range(0, n):
	k = int(input())
	s = input()
	A.append(s)
Q = []

def check_polindrom():
	for x in A:
		try_mix(x[0], x[-1])
		glob_flag = True
		for y in range(0, int(len(x) / 2)):
			glob_flag = flag = try_mix(x[y], x[0 - y - 1])
			if flag != True:
				Q.append('NO')
				break
		if glob_flag:
			Q.append('YES')

def try_mix(sim_a, sim_b):
	if sim_a == sim_b:
		return True
	if low_case.index(sim_a) + 1 == low_case.index(sim_b) - 1:
		return True
	if low_case.index(sim_a) - 1 == low_case.index(sim_b) + 1:
		return True
	return False
check_polindrom()
for x in Q:
	print(str(x))
check_polindrom()
pass


n = int(input())
for x in range(n):
	aq = int(input())
	qa = input()
	q = 0
	for t in range(aq // 2):
		if qa[t] == qa[aq - 1]:
			aq -= 1
		elif ord(qa[t]) - ord(qa[aq - 1]) == 2 or ord(qa[t]) - ord(qa[aq - 1]) == -2:
			aq -= 1
		else:
			q = -1
	if q == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, s) = (int(input()), input())
	s = [ord(c) - ord('0') for c in s]
	print(['NO', 'YES'][all([abs(s[i] - s[-i - 1]) in [0, 2] for i in range(n // 2)])])


for u in range(int(input())):
	n = int(input())
	s = input()
	f = 0
	for i in range(n):
		x = abs(ord(s[i]) - ord(s[n - 1 - i]))
		if x != 0 and x != 2:
			f = 1
	if f == 1:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	a = input()
	b = input()
	i = 0
	j = len(b) - 1
	e = 1
	while i < j:
		if abs(ord(b[i]) - ord(b[j])) != 0 and abs(ord(b[i]) - ord(b[j])) != 2:
			e = 0
			break
		i = i + 1
		j = j - 1
	if e:
		print('YES')
	else:
		print('NO')


def can_be_transformed(word):
	for i in range(len(word) // 2):
		if abs(ord(word[i]) - ord(word[-i - 1])) > 2 or abs(ord(word[i]) - ord(word[-i - 1])) == 1:
			return False
	return True

def main():
	answers = []
	n = int(input())
	for i in range(0, n):
		m = int(input())
		s = input()
		if can_be_transformed(s):
			answers.append('YES')
		else:
			answers.append('NO')
	for i in range(0, n):
		print(answers[i])
main()


def f(s1, s2):
	return not abs(ord(s1) - ord(s2)) in (0, 2)
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	for i in range(n // 2):
		if f(s[i], s[n - i - 1]):
			print('NO')
			break
	else:
		print('YES')


t = int(input())
check = 0
for i in range(t):
	n = int(input())
	string = input()
	a = string[:n // 2]
	b = string[-1:-n // 2 - 1:-1]
	for i in range(n // 2):
		if abs(ord(a[i]) - ord(b[i])) > 2 or abs(ord(a[i]) - ord(b[i])) == 1:
			print('NO')
			check = 1
			break
	if check == 0:
		print('YES')
	check = 0


from collections import defaultdict
t = int(input())
a = 'abcdefghijklmnopqrstuvwxyz'
changes = defaultdict(set)
changes['a'].add('b')
changes['z'].add('y')
for i in range(1, 25):
	(o1, o2) = (a[i - 1], a[i + 1])
	changes[a[i]].add(o1)
	changes[a[i]].add(o2)
for _ in range(t):
	n = int(input())
	s = input()
	half = n // 2
	for x in range(half):
		left = s[x]
		right = s[n - x - 1]
		choice_left = changes[left]
		choice_right = changes[right]
		if not choice_left & choice_right:
			print('NO')
			break
	else:
		print('YES')


t = int(input())

def valid(s, n):
	for i in range(n // 2):
		(a, b) = (ord(s[i]), ord(s[len(s) - 1 - i]))
		diff = abs(a - b)
		if diff not in [0, 2]:
			return False
	return True
for _ in range(t):
	n = int(input())
	s = input()
	if valid(s, n):
		print('YES')
	else:
		print('NO')


def palindrom_change(s):
	flag = True
	for i in range(len(s)):
		k = abs(ord(s[i]) - ord(s[len(s) - i - 1]))
		if k > 2 or k % 2 == 1:
			flag = False
			break
	if flag:
		return 'YES'
	return 'NO'
n = int(input())
a = list()
for j in range(n):
	m = int(input())
	t = input()
	a.append(t)
b = list()
for elem in a:
	b.append(palindrom_change(elem))
print(*b, sep='\n')


T = int(input())
for t in range(T):
	N = int(input())
	S = input()
	for i in range(N // 2):
		a = S[i]
		b = S[-1 - i]
		if a == b:
			continue
		if a > b:
			(a, b) = (b, a)
		if ord(b) - ord(a) == 2:
			continue
		print('NO')
		break
	else:
		print('YES')


def is_palindrome(s, n):
	for i in range(n // 2):
		if ord(s[i]) != ord(s[n - 1 - i]) and abs(ord(s[i]) - ord(s[n - 1 - i])) != 2:
			return False
	return True
for t in range(int(input())):
	n = int(input())
	s = input()
	print('YES' if is_palindrome(s, n) else 'NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input().strip()
	ok = True
	for i in range(n // 2):
		(c1, c2) = (s[i], s[n - i - 1])
		if abs(ord(c2) - ord(c1)) not in {0, 2}:
			ok = False
			break
	print(['NO', 'YES'][ok])


vezes = int(input())
lista = []
for i in range(vezes):
	a = int(input())
	palavra = input()
	verifica = True
	k = len(palavra) - 1
	for j in range(len(palavra) // 2):
		if palavra[j] == palavra[k]:
			k -= 1
		elif chr(ord(palavra[j]) + 1) == chr(ord(palavra[k]) - 1):
			k -= 1
		elif chr(ord(palavra[j]) - 1) == chr(ord(palavra[k]) + 1):
			k -= 1
		else:
			verifica = False
	if verifica == True:
		lista.append('YES')
	else:
		lista.append('NO')
for i in lista:
	print(i)


def solve(n, s):
	return 'YES' if all([ord(s[i]) - ord(s[n - 1 - i]) in (-2, 0, 2) for i in range(n)]) else 'NO'
for t in range(int(input())):
	print(solve(int(input()), input()))


for _ in ' ' * int(input()):
	a = int(input())
	n = 0
	z = input()
	for i in range(a // 2):
		if abs(ord(z[i]) - ord(z[a - i - 1])) not in [0, 2]:
			n = 1
			break
	print('NO' if n else 'YES')


t = int(input())
for q in range(t):
	n = int(input())
	s = input()
	ans = 'YES'
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) == 2 or abs(ord(s[i]) - ord(s[n - i - 1])) == 0:
			pass
		else:
			ans = 'NO'
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	inp = input()
	print('YES' if all((ord(inp[n - i - 1]) - 2 == ord(inp[i]) or ord(inp[i]) == ord(inp[n - i - 1]) or ord(inp[n - i - 1]) + 2 == ord(inp[i]) for i in range(n))) else 'NO')


def overenie(pocPismen, pismena):
	for j in range(int(pocPismen / 2)):
		x = abs(ord(pismena[j]) - ord(pismena[-(j + 1)]))
		if x == 2 or x == 0:
			pass
		else:
			return 'NO'
	return 'YES'
pocSlov = int(input())
odpovede = []
for i in range(pocSlov):
	pocPismen = int(input())
	pismena = input()
	odpovede.append(overenie(pocPismen, pismena))
for i in odpovede:
	print(i)


t = int(input())
for _ in range(t):
	n = int(input())
	s = list(input())
	l = s[:n // 2]
	if len(s[n // 2:]) > n // 2:
		l2 = s[n // 2 + 1:]
		l3 = s[n // 2]
	else:
		l2 = s[n // 2:]
	l2.reverse()
	flag = 0
	for i in range(n // 2):
		if ord(l[i]) + 1 == ord(l2[i]) + 1:
			l[i] = ord(l[i]) + 1
			pass
		elif ord(l[i]) + 1 == ord(l2[i]) - 1:
			l[i] = ord(l[i]) + 1
			pass
		elif ord(l[i]) - 1 == ord(l2[i]) - 1:
			l[i] = ord(l[i]) - 1
			pass
		elif ord(l[i]) - 1 == ord(l2[i]) + 1:
			l[i] = ord(l[i]) - 1
			pass
		else:
			print('NO')
			flag = 1
			break
	if flag == 0:
		if n % 2 != 0:
			if ord(l3) + 1 == l[-1]:
				pass
			elif ord(l3) - 1 == l[-1]:
				pass
			else:
				print('NO')
				flag = 1
			if flag == 0:
				print('YES')
		else:
			print('YES')


T = int(input())
answer = list()
while T > 0:
	n = int(input())
	word = input()
	hn = int(n / 2)
	aux = True
	for i in range(hn):
		d = abs(ord(word[i]) - ord(word[n - i - 1]))
		if d != 0 and d != 2:
			aux = False
			answer.append('NO')
			break
	if aux:
		answer.append('YES')
	T -= 1
for ans in answer:
	print(ans)


from sys import stdin, stdout
input = lambda : stdin.readline().rstrip()
write = stdout.write

def main():
	T = int(input())
	S = [[input() for _ in [0] * 2] for _ in [0] * T]
	for (n, s) in S:
		n = int(n)
		s1 = s[:n // 2]
		s2 = s[n // 2:][::-1]
		for (a, b) in zip(s1, s2):
			x = abs(ord(a) - ord(b))
			if not x or x == 2:
				pass
			else:
				write('NO\n')
				break
		else:
			write('YES\n')
main()


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	tr = True
	for i in range(n // 2):
		k = abs(ord(a[i]) - ord(a[n - i - 1]))
		if k == 0 or k == 2:
			continue
		else:
			tr = False
			break
	if tr:
		print('YES')
	else:
		print('NO')


import math
T = int(input())
for t in range(T):
	length = int(input())
	s = input()
	yes = True
	for i in range(int(math.ceil(length / 2))):
		if ord(s[i]) == ord(s[len(s) - 1 - i]) or abs(ord(s[i]) - ord(s[len(s) - 1 - i])) == 2:
			continue
		else:
			yes = False
			break
	if yes:
		print('YES')
	else:
		print('NO')


Input = lambda : map(int, input().split())
Flag = False
for i in range(int(input())):
	n = int(input())
	s = input()
	for (a, b) in zip(s, s[::-1]):
		(a, b) = sorted(a + b)
		if a == b:
			continue
		elif a == 'a':
			if b == 'c':
				continue
			else:
				print('NO')
				Flag = True
				break
		elif ord(a) + 1 == ord(b) - 1:
			continue
		else:
			print('NO')
			Flag = True
			break
	if Flag == False:
		print('YES')
	else:
		Flag = False


n = int(input())
for i in range(n):
	c = 0
	l = int(input())
	s = input()
	for j in range(l // 2):
		if ord(s[j]) - ord(s[l - j - 1]) == 0 or ord(s[j]) - ord(s[l - j - 1]) == 2 or ord(s[j]) - ord(s[l - j - 1]) == -2:
			c += 1
	if c == l // 2:
		print('YES')
	else:
		print('NO')


def solve(s, n):
	i = 0
	while i < n // 2:
		if s[i] != s[n - i - 1]:
			if abs(ord(s[i]) - ord(s[n - i - 1])) != 2:
				return 'NO'
		i += 1
	return 'YES'
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(solve(s, n))


n = int(input())
for i in range(n):
	l = int(input())
	s = input()
	flag = True
	for i in range(l // 2):
		u = abs(ord(s[i]) - ord(s[l - i - 1]))
		if u != 0 and u != 2:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())

def ch(s1, s2):
	s1 = ord(s1)
	s2 = ord(s2)
	if abs(s1 - s2) == 0 or abs(s1 - s2) == 2:
		return True
	return False

def che(s, n):
	i = 0
	while i < n / 2:
		if not ch(s[i], s[n - i - 1]):
			print('NO', end='\n')
			return
		i = i + 1
	print('YES', end='\n')
for i in range(t):
	x = int(input())
	s = input()
	che(s, x)


t = int(input())
for i in range(t):
	answer = 'YES'
	n = int(input())
	palindrome = input()
	index = n - 1
	for j in range(int(n / 2)):
		distance = abs(ord(palindrome[j]) - ord(palindrome[index]))
		index -= 1
		if distance != 0 and distance != 2:
			answer = 'NO'
			break
	print(answer)


import math
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def getCharPos(char):
	for i in range(0, len(alphabet)):
		if char == alphabet[i]:
			return i

def getPrev(char):
	position = getCharPos(char)
	if position == 0:
		return 'b'
	else:
		return alphabet[position - 1]

def getNext(char):
	position = getCharPos(char)
	if position == 25:
		return 'y'
	else:
		return alphabet[position + 1]
inp = list(map(int, input().split()))
t = inp[0]
answers = []
strings = []

def isPalindrome(str):
	for i in range(0, len(str) // 2):
		prevPrev = getPrev(str[i]) == getPrev(str[len(str) - i - 1])
		prevNext = getPrev(str[i]) == getNext(str[len(str) - i - 1])
		nextNext = getNext(str[i]) == getNext(str[len(str) - i - 1])
		nextPrev = getNext(str[i]) == getPrev(str[len(str) - i - 1])
		if (prevPrev or prevNext or nextNext or nextPrev) == True:
			continue
		else:
			return 'NO'
	return 'YES'
for i in range(0, t):
	str_len = list(map(int, input().split()))[0]
	string = list(map(str, input().split()))[0]
	answers.append(isPalindrome(string))
for answer in answers:
	print(answer)


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	flag = True
	for j in range(n // 2):
		if abs(ord(a[j]) - ord(a[-1 - j])) > 2 or abs(ord(a[j]) - ord(a[-1 - j])) == 1:
			print('NO')
			break
	else:
		print('YES')


t = int(input())
fin = []
for _ in range(t):
	n = int(input())
	a = list(input())
	alpha = list('0abcdefghijklmnopqrstuvwxyz0')
	alph = {alpha[i]: i for i in range(28)}
	b = a[::-1]
	temp = 0
	for i in range(int(n / 2) + 1):
		if not a[i] == b[i]:
			if alph.get(a[i]) and alph.get(b[i]):
				pos = alph.get(a[i])
				tempy = alph.get(b[i])
				if not abs(pos - tempy) == 2:
					temp = 1
					break
			else:
				temp = 0
	if temp == 0:
		fin.append('YES')
	else:
		fin.append('NO')
for i in range(t):
	print(fin[i])


number_of_words = int(input())
for i in range(number_of_words):
	(n, string) = (int(input()), input())
	flag = True
	for index in range(round(n / 2)):
		(max_d, min_d) = (ord(string[-index - 1]) + 1, ord(string[-index - 1]) - 1)
		(max_e, min_e) = (ord(string[index]) + 1, ord(string[index]) - 1)
		if max_e != min_d and max_e != max_d and (min_e != min_d) and (min_e != max_d):
			flag = False
			break
	if flag == False:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline
t = int(input())
for zzz in range(t):
	l = int(input())
	s = input().strip()
	good = True
	for i in range(l):
		j = l - i - 1
		diff = abs(ord(s[i]) - ord(s[j]))
		if diff == 1 or diff > 2:
			good = False
			break
	if good:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	half = n // 2
	mishe = True
	for i in range(half):
		if abs(ord(s[i]) - ord(s[n - i - 1])) == 2 or abs(ord(s[i]) - ord(s[n - i - 1])) == 0:
			pass
		else:
			mishe = False
			break
	if mishe:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	n = int(input())
	s = input()
	f = 1
	for j in range(n // 2):
		if s[j] != s[n - 1 - j]:
			f = 0
			if s[j] == 'a':
				t = [ord('a') + 1]
			elif s[j] == 'z':
				t = [ord('z') - 1]
			else:
				t = [ord(s[j]) - 1, ord(s[j]) + 1]
			if s[n - 1 - j] == 'a':
				t1 = [ord('a') + 1]
			elif s[n - 1 - j] == 'z':
				t1 = [ord('z') - 1]
			else:
				t1 = [ord(s[n - 1 - j]) - 1, ord(s[n - 1 - j]) + 1]
			for k in t:
				if k in t1:
					f = 1
					break
			if f == 0:
				break
	if f == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
ans = [False for i in range(n)]
for i in range(n):
	l = int(input())
	s = input()
	for j in range(0, l // 2):
		if abs(ord(s[j]) - ord(s[l - j - 1])) == 2:
			ans[i] = True
		elif s[j] == s[l - j - 1]:
			ans[i] = True
		else:
			ans[i] = False
			break
for i in range(n):
	if ans[i]:
		print('YES')
	else:
		print('NO')


t = int(input())
for test in range(t):
	n = int(input())
	a = list(input())
	ok = True
	for i in range(n // 2):
		ok &= abs(ord(a[i]) - ord(a[n - 1 - i])) == 0 or abs(ord(a[i]) - ord(a[n - 1 - i])) == 2
	if ok:
		print('YES')
	else:
		print('NO')


def check_palindrome():
	n = int(input())
	answerarray = []
	for i in range(n):
		lenofstring = int(input())
		string = input()
		flag = 0
		for x in range(len(string) // 2):
			if ord(string[x]) - ord(string[len(string) - x - 1]) == 2 or ord(string[x]) - ord(string[len(string) - x - 1]) == -2 or ord(string[x]) - ord(string[len(string) - x - 1]) == 0:
				flag += 1
		if flag == len(string) // 2:
			answerarray.append('YES')
		else:
			answerarray.append('NO')
	for z in answerarray:
		print(z)
check_palindrome()


def gen(c):
	p = []
	x = ord(c)
	if x - 1 >= ord('a'):
		p.append(x - 1)
	if x + 1 <= ord('z'):
		p.append(x + 1)
	return p
t = int(input())
while t:
	flag = 0
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	while i <= j:
		m = set(gen(s[i]))
		n = set(gen(s[j]))
		if len(m & n) == 0:
			flag = 1
			break
		i += 1
		j -= 1
	if flag == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


N = int(input())
for ih in range(N):
	n = int(input())
	A = input()
	flag = True
	for i in range(n):
		(b, c) = ([], [])
		b.append(ord(A[i]) + 1)
		b.append(ord(A[i]) - 1)
		c.append(ord(A[n - i - 1]) + 1)
		c.append(ord(A[n - i - 1]) - 1)
		flag = True
		if b[0] in c or b[1] in c:
			flag = False
		if flag:
			print('NO')
			break
	if not flag:
		print('YES')


def solve(s):
	r = s[::-1]
	if all((r[u] == s[u] or abs(ord(r[u]) - ord(s[u])) == 2 for u in range(len(s)))):
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	n = input()
	s = input()
	solve(s)


import sys

def check(s, n):
	for i in range(n // 2):
		if ord(s[i]) - ord(s[n - i - 1]) not in [-2, 0, 2]:
			return False
	return True
T = int(sys.stdin.readline())
for i in range(T):
	n = int(sys.stdin.readline())
	s = sys.stdin.readline().strip()
	if check(s, n):
		sys.stdout.write('YES\n')
	else:
		sys.stdout.write('NO\n')


n = int(input())
for i in range(0, n):
	l = int(input())
	string = input()
	b = True
	for j in range(0, int(l / 2)):
		if abs(ord(string[j]) - ord(string[l - j - 1])) != 0 and abs(ord(string[j]) - ord(string[l - j - 1])) != 2:
			b = False
	print('YES' if b else 'NO')


import sys
input = sys.stdin.readline

def main():
	direct = [1, -1]

	def check(s):
		i = 0
		j = len(s) - 1
		while i < j:
			a = s[i]
			b = s[j]
			found = False
			for d in direct:
				for dd in direct:
					if a == 'a' and d == -1 or (a == 'z' and d == 1):
						continue
					if b == 'a' and dd == -1 or (b == 'z' and dd == 1):
						continue
					if chr(ord(a) + d) == chr(ord(b) + dd):
						i += 1
						j -= 1
						found = True
						break
				if found:
					break
			if not found:
				return False
		return True
	for _ in range(int(input())):
		n = int(input())
		print('YES' if check(input().strip()) else 'NO')
main()


t = int(input())

def palindromic(n, s):
	for i in range(n // 2):
		diff = abs(ord(s[n - i - 1]) - ord(s[i]))
		if diff > 2 or diff == 1:
			return False
	return True
result = []
for i in range(t):
	n = int(input())
	s = input()
	if palindromic(n, s):
		result.append('YES')
	else:
		result.append('NO')
for i in result:
	print(i)


t = int(input())
for k in range(t):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	flag = 0
	while i < j:
		if s[i] != s[j]:
			if s[i] == 'a':
				if ord(s[j]) - 1 != ord('b'):
					flag = 1
					break
			if s[j] == 'a':
				if ord(s[i]) - 1 != ord('b'):
					flag = 1
					break
			if s[i] == 'z':
				if ord(s[j]) + 1 != ord('y'):
					flag = 1
					break
			if s[j] == 'z':
				if ord(s[i]) + 1 != ord('y'):
					flag = 1
					break
			elif ord(s[i]) - 1 != ord(s[j]) + 1 and ord(s[i]) + 1 != ord(s[j]) - 1:
				flag = 1
				break
		i = i + 1
		j = j - 1
	if flag == 1:
		print('NO')
	else:
		print('YES')


from sys import stdin

def is_last(c):
	if c == 'a' or c == 'z':
		return True
	return False

def sol(s):
	for i in range(len(s) // 2):
		if s[i] == s[len(s) - i - 1]:
			continue
		if is_last(s[i]) and is_last(s[len(s) - i - 1]):
			return 'NO'
		if abs(ord(s[i]) - ord(s[len(s) - i - 1])) != 2:
			return 'NO'
	return 'YES'
t = int(stdin.readline())
for it in range(t):
	stdin.readline()
	s = stdin.readline().rstrip()
	print(sol(s))


import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

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

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x

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

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
t = nu()
for it in range(t):
	n = nu()
	s = input()
	fl = True
	for i in range(n // 2):
		pp = s[i]
		zz = s[n - 1 - i]
		qq = ord(pp)
		ll = ord(zz)
		if qq + 1 == ll + 1 or qq + 1 == ll - 1 or qq - 1 == ll - 1 or (qq - 1 == ll + 1):
			continue
		fl = False
	if fl == True:
		print('YES')
	else:
		print('NO')


t = int(input())
alh = 'abcdefghijklmnopqrstuvwxyz'
a = [0] * 120
for i in range(t):
	n = int(input())
	s = input()
	otv = 'YES'
	for i in range(n):
		a[i] = alh.index(s[i])
	for i in range(n):
		z = a[i]
		z1 = a[n - i - 1]
		if abs(z - z1) != 2 and z - z1 != 0:
			otv = 'NO'
	print(otv)


import math

def can_be_palindrome(l, s):
	for i in range(0, math.floor(l / 2)):
		if s[i] != s[-1 * (i + 1)]:
			if math.fabs(ord(s[i]) - ord(s[-1 * (i + 1)])) != 2:
				return 'NO'
	return 'YES'
n = int(input())
for i in range(0, n):
	l = int(input())
	s = input()
	print(can_be_palindrome(l, s))


x = int(input())

def abs(a, b):
	if a > b:
		return a - b
	else:
		return b - a
for i in range(x):
	flag = 0
	t1 = int(input())
	t = input()
	for i in range(t1 // 2):
		if t == 'lm':
			print(abs(ord(t[i]), ord(t[t1 - i - 1])))
		if abs(ord(t[i]), ord(t[t1 - i - 1])) == 0 or abs(ord(t[i]), ord(t[t1 - i - 1])) == 2:
			continue
		else:
			flag = 1
			print('NO')
			break
	if flag == 0:
		print('YES')


tam = int(input())
for i in range(tam):
	comprimento = int(input())
	palavra = input()
	p1 = 0
	p2 = len(palavra) - 1
	boolean = True
	while p1 < p2:
		aux1 = ord(palavra[p1])
		aux2 = ord(palavra[p2])
		if aux1 + 1 == aux2 - 1 or aux2 + 1 == aux1 - 1 or aux1 == aux2:
			p1 += 1
			p2 -= 1
		else:
			boolean = False
			break
	if boolean:
		print('YES')
	else:
		print('NO')


from math import ceil
for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	flag = 1
	for i in range(ceil(n)):
		if ord(s[i]) - 1 != ord(s[n - i - 1]) - 1 and ord(s[i]) - 1 != ord(s[n - i - 1]) + 1 and (ord(s[i]) + 1 != ord(s[n - i - 1]) - 1) and (ord(s[i]) + 1 != ord(s[n - i - 1]) + 1):
			flag = 0
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(t):
	n = int(input())
	s = input()
	if s == s[::-1]:
		print('YES')
	else:
		(f, se) = (s[:len(s) // 2], s[len(s) // 2:])
		s2 = se[::-1]
		pos = True
		for i in range(n // 2):
			l = [chr(ord(f[i]) - 1), chr(ord(f[i]) + 1)]
			if chr(ord(s2[i]) - 1) not in l and chr(ord(s2[i]) + 1) not in l:
				pos = False
				break
		print('YES' if pos else 'NO')


t = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	n = int(input())
	string = input()
	palindrome = True
	i = 0
	j = len(string) - 1
	while i <= j:
		if string[i] != string[j]:
			esq = alphabet.index(string[i])
			dir = alphabet.index(string[j])
			if esq + 1 != dir - 1 and esq + 1 != dir + 1 and (esq - 1 != dir - 1) and (esq - 1 != dir + 1):
				palindrome = False
		i += 1
		j -= 1
	if palindrome:
		print('YES')
	else:
		print('NO')


a = int(input())
s = []
for x in range(a):
	l = int(input())
	s.append(input())
for x in s:
	flag = True
	b = x[0:len(x) // 2]
	c = x[-1:len(x) // 2 - 1:-1]
	for y in range(len(b)):
		if b[y] == c[y]:
			continue
		elif ord(b[y]) + 1 == ord(c[y]) - 1 or ord(b[y]) - 1 == ord(c[y]) + 1:
			continue
		else:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')


ABC = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(int(input())):
	n = int(input())
	s = list(input())
	error = 0
	for i in range(n // 2):
		if s[i] == ABC[0] or s[-i - 1] == ABC[0]:
			if s[-i - 1] == ABC[1] or s[i] == ABC[1]:
				print('NO')
				error = 1
				break
			elif abs(ABC.index(s[i]) - ABC.index(s[-i - 1])) == 1 or abs(ABC.index(s[i]) - ABC.index(s[-i - 1])) >= 3:
				print('NO')
				error = 1
				break
		elif s[i] == ABC[25] or s[-i - 1] == ABC[25]:
			if s[-1 - i] == ABC[24] or s[i] == ABC[24]:
				print('NO')
				error = 1
				break
			elif abs(ABC.index(s[i]) - ABC.index(s[-i - 1])) == 1 or abs(ABC.index(s[i]) - ABC.index(s[-i - 1])) >= 3:
				print('NO')
				error = 1
				break
		elif abs(ABC.index(s[i]) - ABC.index(s[-i - 1])) == 1 or abs(ABC.index(s[i]) - ABC.index(s[-i - 1])) >= 3:
			print('NO')
			error = 1
			break
	if error == 0:
		print('YES')


n = int(input())
for i in range(n):
	c = 0
	x = int(input())
	s = input()
	for j in range(x // 2):
		a = ord(s[j])
		b = ord(s[x - j - 1])
		if abs(a - b) == 2 or abs(a - b) == 0:
			c += 1
	if c == x // 2:
		print('YES')
	else:
		print('NO')


def getV(c):
	if c == 'a':
		return ['b']
	if c == 'z':
		return ['y']
	return [chr(ord(c) + 1), chr(ord(c) - 1)]
T = int(input().strip())
for i in range(T):
	n = int(input().strip())
	s = input().strip()
	for j in range(n // 2):
		first = getV(s[j])
		second = getV(s[n - j - 1])
		b = False
		for c in second:
			if c in first:
				b = True
				break
		if not b:
			print('NO')
			break
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	flag = 1
	while i <= j:
		(a, b, c) = ('', '', '')
		if s[j] == 'a':
			b = 'b'
		elif s[j] == 'z':
			b = 'y'
		else:
			b = chr(ord(s[j]) + 1)
			c = chr(ord(s[j]) - 1)
		(a2, b2, c2) = ('zxcv', 'zxcv', 'zxcv')
		if s[i] == 'a':
			b2 = 'b'
		elif s[i] == 'z':
			b2 = 'y'
		else:
			b2 = chr(ord(s[i]) + 1)
			c2 = chr(ord(s[i]) - 1)
		if a2 == a or a2 == b or a2 == c:
			zx = ''
		elif b2 == a or b2 == b or b2 == c:
			zx = ''
		elif c2 == a or c2 == b or c2 == c:
			zx = ''
		else:
			flag = 0
			break
		i += 1
		j -= 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	s = input()
	ok = 0
	for i in range(n):
		v = abs(ord(s[i]) - ord(s[n - i - 1]))
		if v != 0 and v != 2:
			ok = 1
	if ok:
		print('NO')
	else:
		print('YES')
	t -= 1


test_cases = int(input())

def before_after(ch):
	alpha = '+abcdefghijklmnopqrstuvwxyz*'
	position = alpha.index(ch)
	return [alpha[position - 1], alpha[position + 1]]
for i in range(test_cases):
	size = int(input())
	word = input()
	first_half = word[:size // 2]
	second_half = word[size // 2:][::-1]
	if sum([1 for i in range(size // 2) if len(set(before_after(first_half[i]) + before_after(second_half[i]))) < 4]) == size // 2:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	n = int(input())
	s = input()
	flag = False
	for j in range(n // 2):
		if abs(ord(s[j]) - ord(s[-j - 1])) > 2 or abs(ord(s[j]) - ord(s[-j - 1])) == 1:
			flag = True
	print('NO') if flag else print('YES')


t = int(input())
for i in range(t):
	x = int(input())
	s = list(input())
	(a, b) = (s[:x // 2], s[x // 2:])
	b.reverse()
	for j in range(x // 2):
		if abs(ord(a[j]) - ord(b[j])) != 0 and abs(ord(a[j]) - ord(b[j])) != 2:
			print('NO')
			break
	else:
		print('YES')


n = int(input())
a = sorted(list('qwertyuiopasdfghjklzxcvbnm'))
b = {}
t = len(a)
for i in range(t):
	if i == 0:
		b[a[i]] = set([a[i + 1]])
	elif i == t - 1:
		b[a[i]] = set([a[i - 1]])
	else:
		b[a[i]] = set([a[i - 1], a[i + 1]])

def check(s, t, neib=b):
	r = True
	for i in range(t // 2):
		if len(b[s[i]] & b[s[t - 1 - i]]) == 0:
			r = False
			break
		else:
			pass
	return r
for i in range(n):
	x = int(input())
	s = input()
	if check(s, x):
		print('YES')
	else:
		print('NO')


l = [set([2])]
for i in range(ord('b'), ord('z')):
	l.append(set([i - 96 + 1, i - 96 - 1]))
l.append(set([25]))
t = int(input())
for __ in range(t):
	n = int(input())
	s = input()
	for i in range(n // 2):
		if len(l[ord(s[i]) - 97].intersection(l[ord(s[-i - 1]) - 97])) == 0:
			print('NO')
			break
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	h = n // 2
	s = input()
	f = True
	for i in range(0, h):
		d = abs(ord(s[i]) - ord(s[n - 1 - i]))
		if d != 0 and d != 2:
			f = False
			break
	if f:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, s) = (input(), input())
	ans = 'YES'
	for i in range(len(s)):
		if not abs(ord(s[i]) - ord(s[-(i + 1)])) in [0, 2]:
			ans = 'NO'
			break
	print(ans)


number_of_testcases = int(input())
for i in range(number_of_testcases):
	length_of_string = int(input())
	string = input()
	i = 0
	j = length_of_string - 1
	while i < j:
		asciidiff = abs(ord(string[i]) - ord(string[j]))
		if asciidiff != 0 and asciidiff != 2:
			print('NO')
			break
		i += 1
		j -= 1
	else:
		print('YES')


const = int(input())
for _ in range(const):
	n = int(input())
	s = input()
	left = s[0:n // 2]
	right = s[n // 2:][::-1]
	for i in range(len(left)):
		if abs(ord(left[i]) - ord(right[i])) == 1 or abs(ord(left[i]) - ord(right[i])) > 2:
			print('NO')
			break
	else:
		print('YES')


n = int(input())
string = []
for i in range(n):
	input()
	string.append(input(''))

def defile(golok):
	for i in range(len(golok)):
		m = ord(golok[i])
		n = ord(golok[len(golok) - 1 - i])
		if abs(m - n) != 2 and m != n:
			return 0
			break
		else:
			continue
for kok in string:
	if defile(kok) == 0:
		print('NO')
	else:
		print('YES')


for ii in range(int(input())):
	l = int(input())
	s = input()
	f = 0
	for i in range(l // 2):
		if abs(ord(s[i]) - ord(s[l - 1 - i])) == 2 or s[i] == s[l - i - 1]:
			continue
		else:
			f = 1
			break
	if f == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	n = int(input())
	st = input()
	c = 0
	for j in range(0, int(n / 2)):
		if abs(ord(st[j]) - ord(st[n - j - 1])) == 0 or abs(ord(st[j]) - ord(st[n - j - 1])) == 2:
			c = c + 1
		else:
			c = c
	if c == n / 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	flag = 0
	for j in range(0, n // 2):
		val = abs(ord(s[j]) - ord(s[n - j - 1]))
		if val > 2 or val == 1:
			print('NO')
			flag = 1
			break
	if flag == 0:
		print('YES')


import sys
t = int(sys.stdin.readline())
for loop in range(t):
	n = int(sys.stdin.readline())
	word = sys.stdin.readline()
	if n % 2 == 0:
		out = 'YES'
		for loop in range(n // 2):
			if not (abs(ord(word[loop]) - ord(word[n - 1 - loop])) == 2 or abs(ord(word[loop]) - ord(word[n - 1 - loop])) == 0):
				out = 'NO'
				break
	else:
		out = 'YES'
		for loop in range((n - 1) // 2):
			if not (abs(ord(word[loop]) - ord(word[n - 1 - loop])) == 2 or abs(ord(word[loop]) - ord(word[n - 1 - loop])) == 0):
				out = 'NO'
				break
	print(out)


def main():
	m = int(input())
	for j in range(m):
		m2 = int(input())
		n = input()
		res = True
		for i in range(len(n) // 2):
			c1 = n[i]
			c2 = n[len(n) - 1 - i]
			is_ok = False
			for diff in [(-1, -1), (-1, 1), (1, -1), (1, 1)]:
				cn1 = chr(ord(c1) + diff[0])
				cn2 = chr(ord(c2) + diff[1])
				if 'a' <= cn1 <= 'z' and 'a' <= cn2 <= 'z':
					if cn1 == cn2:
						is_ok = True
			if not is_ok:
				res = False
				break
		print('YES' if res else 'NO')
main()


for _ in range(int(input())):
	n = int(input())
	s = input()
	if n == 0:
		print('YES')
	else:
		count = 0
		for i in range(n // 2):
			if ord(s[i]) - ord(s[n - 1 - i]) == 2 or s[i] == s[n - 1 - i] or ord(s[i]) - ord(s[n - 1 - i]) == -2:
				count += 1
		if count == n // 2:
			print('YES')
		else:
			print('NO')


import itertools as it
changes = {'a': [1], 'z': [-1]}
n = int(input())
for _ in range(n):
	m = int(input())
	A = input()
	is_pal = True
	for i in range(m // 2):
		(a, b) = (A[i], A[-i - 1])
		one = changes.get(a, [1, -1])
		two = changes.get(b, [1, -1])
		is_pal = is_pal and any([ord(a) + a_off == ord(b) + b_off for (a_off, b_off) in it.product(one, two)])
	print('YES' if is_pal else 'NO')


import string
n = input()
abc = string.ascii_lowercase
for i in range(0, int(n)):
	x = input()
	word = input()
	yes = 'YES'
	for s in range(int(len(word) / 2) + 1):
		if not (abs(ord(word[s]) - ord(word[-(s + 1)])) == 2 or abs(ord(word[s]) - ord(word[-(s + 1)])) == 0):
			yes = 'NO'
			break
	print(yes)


def check(s, n):
	i = 0
	j = n - 1
	while i < j:
		if s[i] != s[j]:
			a = ord(s[i])
			b = ord(s[j])
			if abs(a - b) != 2:
				return 'NO'
		i += 1
		j -= 1
	return 'YES'
for _ in range(int(input())):
	n = int(input())
	s = input()
	print(check(s, n))


cases = int(input(''))
x = 0
count = 0
b = 0
while x < cases:
	x = x + 1
	len = int(input(''))
	string = input('')
	for i in range(1, len):
		if string[i - 1] != string[-i]:
			if chr(ord(string[i - 1]) + 1) == chr(ord(string[-i]) - 1) or chr(ord(string[-i]) + 1) == chr(ord(string[i - 1]) - 1):
				count = count + 1
				continue
			else:
				b = 5
		else:
			count = count + 1
	if b == 5:
		print('NO')
		b = 0
	elif count >= 1:
		print('YES')


t = int(input())
res = []
for i in range(t):
	n = int(input())
	s = input()
	f = 0
	for i in range(0, n // 2):
		a = ord(s[i])
		b = ord(s[n - i - 1])
		if a == b or a - 1 == b - 1 or a + 1 == b - 1 or (a - 1 == b + 1) or (a + 1 == b + 1):
			f = 0
		else:
			res.append('NO')
			f = 1
			break
	if f == 0:
		res.append('YES')
for i in res:
	print(i)


import math
num = int(input())
strs = []
leng = []
for x in range(num):
	leng.append(int(input()))
	strs.append(input())
for v in range(len(strs)):
	le = leng[v] - 1
	st = strs[v]
	yes = True
	for ite in range(math.floor(len(st) / 2)):
		if ord(st[ite]) == ord(st[le - ite]) or ord(st[ite]) + 1 == ord(st[le - ite]) - 1 or ord(st[ite]) - 1 == ord(st[le - ite]) + 1:
			pass
		else:
			yes = False
	if yes:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	k = int(input())
	s = input()
	flag = True
	for i in range(k // 2):
		dif = abs(ord(s[i]) - ord(s[k - i - 1]))
		if dif != 2 and dif != 0:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


nvalues = int(input())
for i in range(nvalues):
	n = int(input())
	alphastr = input()
	for j in range(0, int(n / 2)):
		if abs(ord(alphastr[j]) - ord(alphastr[n - 1 - j])) not in (0, 2):
			print('NO')
			break
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	h = n // 2
	for j in range(h):
		m = abs(ord(s[j]) - ord(s[len(s) - (j + 1)]))
		if m > 2 or m == 1:
			print('NO')
			break
	else:
		print('YES')


import string
from collections import OrderedDict
import math
od = OrderedDict(zip(string.ascii_lowercase, range(1, 27)))

def canWe(strr):
	if len(strr) == 0:
		return True
	elif abs(od[strr[0]] - od[strr[-1]]) > 2 or abs(od[strr[0]] - od[strr[-1]]) == 1:
		return False
	else:
		return canWe(strr[1:-1])
t = input()
t = int(t)
for i in range(0, t):
	n = int(input())
	strr = input()
	if canWe(strr):
		print('YES')
	else:
		print('NO')


import sys
from array import array

def readline():
	return sys.stdin.buffer.readline().decode('utf-8')
t = int(readline())
for _ in range(t):
	n = int(readline())
	s = readline().rstrip()
	if all((abs(ord(s[i]) - ord(s[n - i - 1])) in (0, 2) for i in range(n))):
		print('YES')
	else:
		print('NO')


def ispal(a):
	n = len(a)
	for i in range(n // 2):
		if a[i] != a[n - 1 - i]:
			return False
	return True
for _ in range(int(input())):
	n = int(input())
	s = input()
	if ispal(s):
		print('YES')
	else:
		flag = True
		for i in range(n // 2):
			if abs(ord(s[i]) - ord(s[n - 1 - i])) == 2 or abs(ord(s[i]) - ord(s[n - 1 - i])) == 0:
				continue
			else:
				flag = False
				break
		if flag == True:
			print('YES')
		else:
			print('NO')


t = int(input())
an = []
raz = 0
for i in range(t):
	n = int(input())
	s = str(input())
	sm = 0
	for j in range(int(n / 2)):
		raz = abs(ord(s[j]) - ord(s[-(j + 1)]))
		if raz == 0 or raz == 2:
			sm += 1
	if sm == n / 2:
		an.append('YES')
	else:
		an.append('NO')
for i in range(t):
	print(an[i])


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	ans = 0
	for j in range(n):
		if abs(ord(a[j]) - ord(a[n - j - 1])) > 2 or ord(a[j]) % 2 != ord(a[n - j - 1]) % 2:
			ans += 1
	if ans:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	m = int(input())
	s = input()
	m2 = m // 2
	ans = 1
	for i in range(m2):
		j = m - i - 1
		ci = ord(s[i])
		cj = ord(s[j])
		d = abs(ci - cj)
		if d != 0 and d != 2:
			ans = 0
			break
	if ans:
		print('YES')
	else:
		print('NO')


def calc(c):
	if c == 'a':
		return ['b']
	if c == 'z':
		return ['y']
	return [chr(ord(c) - 1), chr(ord(c) + 1)]

def solve(N, S):
	M = N // 2
	for i in range(M):
		a = S[i]
		b = S[-1 - i]
		sa = calc(a)
		sb = calc(b)
		ok = False
		for ca in sa:
			for cb in sb:
				if ca == cb:
					ok = True
		if not ok:
			return False
	return True

def main():
	T = int(input())
	for _ in range(T):
		N = int(input())
		S = input()
		assert len(S) == N
		print('YES' if solve(N, S) else 'NO')
main()


import string
a = 'b' + string.ascii_lowercase + 'y'
for i in int(input()) * [0]:
	u = 1
	c = int(input())
	b = list(input())
	for i in range(c):
		z = a[1:].find(b[i]) + 1
		x = [a[z - 1], a[z + 1]]
		b[i] = x
	print('NYOE S'[all((b[i][0] in b[c - i - 1] or b[i][1] in b[c - i - 1] for i in range(0 - -c // 2)))::2])


def palindromictwist(A):
	front = 0
	end = len(A) - 1
	while front < end:
		if ord(A[front]) + 1 == ord(A[end]) + 1 or ord(A[front]) - 1 == ord(A[end]) - 1 or ord(A[front]) + 1 == ord(A[end]) - 1 or (ord(A[front]) - 1 == ord(A[end]) + 1):
			front = front + 1
			end = end - 1
		else:
			return 'NO'
	return 'YES'
test = int(input())
for i in range(test):
	size = int(input())
	A = list(input())
	print(palindromictwist(A))


T = int(input())
for i in range(T):
	n = int(input())
	a = input()
	flag = 0
	for j in range(n // 2):
		val = abs(ord(a[j]) - ord(a[-j - 1]))
		if val != 2 and val != 0:
			flag = -1
			break
	if flag == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n1 = int(input()) // 2
	n = n1 * 2
	s = str(input())
	flag = True
	for i in range(n1):
		if s[i] == 'a' and s[n - i - 1] == 'c':
			continue
		elif s[i] == 'z' and s[n - i - 1] == 'x':
			continue
		elif s[i] == s[n - i - 1] or abs(ord(s[i]) - ord(s[n - i - 1])) == 2:
			continue
		else:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout, setrecursionlimit
from gc import disable
gets = input
puts = print
input = stdin.readline
print = stdout.write

def main() -> int:
	disable()
	k = int(input())
	for _ in range(k):
		flag = True
		n = int(input())
		s = gets()
		s1 = s[:n >> 1]
		if n & 1:
			s2 = s[(n >> 1) + 1:]
		else:
			s2 = s[n >> 1:]
		for i in range(n >> 1):
			if not (ord(s1[i]) + 1 == ord(s2[-1 - i]) + 1 or ord(s1[i]) - 1 == ord(s2[-1 - i]) + 1 or ord(s1[i]) + 1 == ord(s2[-1 - i]) - 1 or (ord(s1[i]) - 1 == ord(s2[-1 - i]) - 1)):
				print('NO\n')
				flag = False
				break
		if flag:
			print('YES\n')
	return 0
main()


n = int(input())
for i in range(n):
	m = int(input())
	s = str(input())
	l = 0
	r = m - 1
	f = 0
	while l <= r:
		a = ''
		b = ''
		flag = 0
		flag1 = 0
		if s[l] == 'a':
			a = a + 'b'
			flag = 1
		elif s[l] == 'z':
			a = a + 'y'
			flag = 1
		if s[r] == 'a':
			b = b + 'b'
			flag1 = 1
		elif s[r] == 'z':
			b = b + 'y'
			flag1 = 1
		if flag == 0 and flag1 == 0:
			if ord(s[l]) + 1 == ord(s[r]) + 1:
				pass
			elif ord(s[l]) + 1 == ord(s[r]) - 1:
				pass
			elif ord(s[l]) - 1 == ord(s[r]) + 1:
				pass
			elif ord(s[l]) - 1 == ord(s[r]) - 1:
				pass
			else:
				f = 1
				break
		elif flag == 0 and flag1 == 1:
			if ord(s[l]) + 1 == ord(b):
				pass
			elif ord(s[l]) - 1 == ord(b):
				pass
			else:
				f = 1
				break
		elif flag == 1 and flag1 == 0:
			if ord(a) == ord(s[r]) - 1:
				pass
			elif ord(a) == ord(s[r]) + 1:
				pass
			else:
				f = 1
				break
		elif ord(a) == ord(b):
			pass
		else:
			f = 1
			break
		l = l + 1
		r = r - 1
	if f == 0:
		print('YES')
	else:
		print('NO')


T = int(input())
result = []
for i in range(T):
	l = int(input())
	string = input()
	for j in range(0, int(l / 2)):
		if abs(ord(string[j]) - ord(string[l - j - 1])) <= 2 and abs(ord(string[j]) - ord(string[l - j - 1])) != 1:
			pass
		else:
			result.append('NO')
			break
	else:
		result.append('YES')
for i in result:
	print(i)


TC = int(input())
while TC > 0:
	lenght = int(input())
	line = input()
	numCheck = lenght // 2
	numPass = 0
	for i in range(0, numCheck):
		numDiv = ord(line[i]) - ord(line[lenght - 1])
		print
		if ord(line[i]) == ord(line[lenght - 1]) or numDiv == 2 or numDiv == -2:
			numPass += 1
		else:
			print('NO')
			break
		lenght -= 1
	if numPass == numCheck:
		print('YES')
	TC -= 1


def palindromic(t, p):
	meio = t // 2
	temp = True
	i = 0
	while i < meio and temp:
		if p[i] != p[t - i - 1]:
			t1 = ord(p[i])
			t2 = ord(p[t - i - 1])
			t3 = {t1 - 1, t1, t1 + 1}
			t4 = {t2 - 1, t2, t2 + 1}
			ans = t3.intersection(t4)
			temp = len(ans) > 0 and t1 not in ans and (t2 not in ans)
		i += 1
	return temp
n = int(input())
for i in range(n):
	t = int(input())
	p = str(input())
	p_ = palindromic(t, p)
	print('YES' if p_ else 'NO')


for i in range(int(input())):
	n = int(input())
	s = str(input())
	if s == s[::-1]:
		print('YES')
	else:
		i = 0
		j = n - 1
		t = 0
		while i < j:
			if s[i] != s[j]:
				if ord(s[i]) + 1 == ord(s[j]) - 1:
					pass
				elif ord(s[i]) - 1 == ord(s[j]) + 1:
					pass
				else:
					t = 1
					break
			i = i + 1
			j = j - 1
		if t == 0:
			print('YES')
		else:
			print('NO')


from string import ascii_lowercase
t = int(input())
abc = ascii_lowercase[:27]
for _ in range(t):
	midd = int(int(input()) / 2)
	scd = input()
	fst = scd[:midd]
	scd = scd[::-1][:midd]
	is_palin = True
	for i in range(midd):
		(l1, l2) = (fst[i], scd[i])
		is_palin &= abs(ord(l1) - ord(l2)) in {0, 2}
	if is_palin:
		print('YES')
	else:
		print('NO')


from typing import Set, List

def twists_for_letter(letter) -> Set[str]:
	if letter == 'a':
		return {'b'}
	elif letter == 'z':
		return {'y'}
	else:
		o = ord(letter)
		return {chr(o - 1), chr(o + 1)}

def generate_twists(string) -> List[Set[str]]:
	return [twists_for_letter(l) for l in string]

def is_twist_palindrome(string):
	twists = generate_twists(string)
	for i in range(len(string) // 2):
		intersection = twists[i].intersection(twists[len(string) - i - 1])
		if len(intersection) == 0:
			return False
	return True
cases = int(input())
for _ in range(cases):
	size = int(input())
	string = input()
	print('YES' if is_twist_palindrome(string) else 'NO')


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(input())
	l1 = l[:n // 2]
	l2 = l[n // 2:]
	l2.reverse()
	for i in range(n // 2):
		if abs(ord(l1[i]) - ord(l2[i])) == 0 or abs(ord(l1[i]) - ord(l2[i])) == 2:
			continue
		else:
			print('NO')
			break
	else:
		print('YES')


def pos(ch):
	alph = 'abcdefghijklmnopqrstuvwxyz'
	result = 0
	for i in range(len(alph)):
		if alph[i] == ch:
			result = i
			break
	return result
tests = int(input())
for o in range(tests):
	n = int(input())
	s = input()
	r = 0
	isPossible = True
	for i in range(n // 2):
		r = abs(pos(s[i]) - pos(s[n - i - 1]))
		if not (r == 0 or r == 2):
			isPossible = False
	if isPossible:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	l = int(input())
	s = input()
	q = 5
	s1 = s[:l // 2]
	s2 = s[-(l // 2):][::-1]
	for (ind, item) in enumerate(s1):
		if item != s2[ind] and abs(ord(item) - ord(s2[ind])) != 2:
			q = 3
			break
	if q == 3:
		print('NO')
	else:
		print('YES')


def Check(a, b):
	a = [ord(a) - 1, ord(a) + 1]
	b = [ord(b) - 1, ord(b) + 1]
	for x in a:
		if x in b:
			return True
	for x in b:
		if x in a:
			return True
	return False

def palindrome(sss):
	n = len(sss)
	for i in range(0, int(n / 2)):
		if Check(sss[i], sss[n - i - 1]) == False:
			return False
	return True
test = int(input())
for _ in range(test):
	n = int(input())
	sss = input()
	if palindrome(sss):
		print('YES')
	else:
		print('NO')


T = int(input())
for case in range(T):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	flag = 1
	while i < j:
		flag1 = 0
		temp1 = ord(s[i])
		temp2 = ord(s[j])
		if s[i] != 'a' and s[j] != 'a':
			if temp1 == temp2:
				flag1 = 1
		if s[i] != 'z' and s[j] != 'z':
			if temp1 == temp2:
				flag1 = 1
		if s[i] != 'a' and s[j] != 'z':
			if temp1 - 1 == temp2 + 1:
				flag1 = 1
		if s[i] != 'z' and s[j] != 'a':
			if temp1 + 1 == temp2 - 1:
				flag1 = 1
		if flag1 == 0:
			flag = 0
			break
		i += 1
		j -= 1
	if flag:
		print('YES')
	else:
		print('NO')


n = int(input())
g = 1
for i in range(n):
	l = int(input())
	s = input()
	j = -1
	while j < l // 2:
		j += 1
		if abs(ord(s[j]) - ord(s[l - j - 1])) == 2 or abs(ord(s[j]) - ord(s[l - j - 1])) == 0:
			continue
		else:
			g = 0
			break
	if g == 0:
		print('NO')
		g = 1
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	last = n - 1
	ans = True
	for i in range(n // 2):
		x = abs(ord(s[i]) - ord(s[last - i]))
		if x > 2 or x == 1:
			ans = False
	if ans:
		print('YES')
	else:
		print('NO')


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	r = True
	l = len(s)
	for j in range(0, l // 2):
		x = s[j]
		y = s[l - j - 1]
		nextx = []
		nexty = []
		if x == 'a':
			nextx.append(ord(x) + 1)
		elif x == 'z':
			nextx.append(ord(x) - 1)
		else:
			nextx.append(ord(x) + 1)
			nextx.append(ord(x) - 1)
		if y == 'a':
			nexty.append(ord(y) + 1)
		elif y == 'z':
			nexty.append(ord(y) - 1)
		else:
			nexty.append(ord(y) + 1)
			nexty.append(ord(y) - 1)
		f = False
		for p in nextx:
			for q in nexty:
				if p == q:
					f = True
					break
			if f:
				break
		if f == False:
			r = False
			break
	if r:
		print('YES')
	else:
		print('NO')


strings = int(input())
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
results = []
for i in range(strings):
	letters = int(input())
	word = input()
	isPossible = False
	for l in range(letters // 2):
		firstLetter = word[l]
		lastLetter = word[-(l + 1)]
		distance = abs(alphabet.index(firstLetter) - alphabet.index(lastLetter))
		if distance > 2 or distance == 1:
			isPossible = False
			break
		else:
			isPossible = True
	if isPossible == False:
		results.append('NO')
	else:
		results.append('YES')
print(*results, sep='\n')


def next(a, b):
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	return abs(alpha.index(a) - alpha.index(b)) == 2 or alpha.index(a) == alpha.index(b)
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	s = input()
	flag = False
	for i in range(n // 2):
		if not next(s[i], s[n - i - 1]):
			flag = True
			break
	if flag:
		ans.append('NO')
	else:
		ans.append('YES')
for i in ans:
	print(i)


import sys, collections
tc = int(sys.stdin.readline())
res = dict().fromkeys([chr(i + 97) for i in range(26)])
for i in res:
	res[i] = set()
for i in res:
	if i == 'a':
		res[i].add('b')
	elif i == 'z':
		res[i].add('y')
	else:
		res[i].add(chr(ord(i) - 1))
		res[i].add(chr(ord(i) + 1))
for _ in range(tc):
	n = int(sys.stdin.readline())
	arr = list(sys.stdin.readline().rstrip())
	left = 0
	right = n - 1
	can = True
	while left < right:
		if arr[left] != arr[right]:
			if len(res[arr[left]].intersection(res[arr[right]])) == 0:
				can = False
				break
		left += 1
		right -= 1
	print('YES' if can else 'NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	i = 0
	flag = True
	while i < int(n / 2) and flag:
		if s[i] == 'z':
			if s[n - i - 1] != 'x' and s[n - i - 1] != s[i]:
				flag = False
		elif s[i] == 'a':
			if s[n - i - 1] != s[i] and s[n - i - 1] != 'c':
				flag = False
		elif s[n - i - 1] == 'a':
			if s[i] != 'c' and s[i] != s[n - i - 1]:
				flag = False
		elif s[n - i - 1] == 'z':
			if s[i] != 'x' and s[i] != s[n - i - 1]:
				flag = False
		elif s[i] == 'y':
			if s[n - i - 1] != 'y' and s[n - i - 1] != 'w':
				flag = False
		elif s[i] == 'b':
			if s[n - i - 1] != 'b' and s[n - i - 1] != 'd':
				flag = False
		elif s[n - i - 1] == 'y':
			if s[i] != 'y' and s[i] != 'w':
				flag = False
		elif s[n - i - 1] == 'b':
			if s[i] != 'b' and s[i] != 'd':
				flag = False
		else:
			p = s[i]
			q = ord(s[i])
			r = chr(q - 2)
			l = chr(q + 2)
			if s[n - i - 1] != p and s[n - i - 1] != r and (s[n - i - 1] != l):
				flag = False
		i = i + 1
	if flag == False:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	b = int(input())
	s = input()
	f = 1
	for i in range(b // 2):
		if abs(ord(s[i]) - ord(s[b - 1 - i])) == 1 or abs(ord(s[i]) - ord(s[b - 1 - i])) > 2:
			f = 0
	if f:
		print('YES')
	else:
		print('NO')


def nxt(a):
	if a == 'z':
		return 'A'
	return chr(ord(a) + 1)

def prv(a):
	if a == 'a':
		return 'B'
	return chr(ord(a) - 1)
t = int(input())
for _ in range(t):
	n = int(input()) // 2
	a = input()
	go = True
	for i in range(n):
		aa = [nxt(a[i]), prv(a[i])]
		b = [nxt(a[-i - 1]), prv(a[-i - 1])]
		tmp = False
		for i in b:
			if i in aa:
				tmp = True
		if not tmp:
			go = False
	if go:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	i = flag = 0
	j = n - 1
	while True:
		if i > j:
			break
		if s[i] == s[j]:
			i += 1
			j -= 1
		elif s[i] != s[j]:
			if abs(ord(s[i]) - ord(s[j])) != 2:
				flag = 1
				break
			i += 1
			j -= 1
	if flag:
		print('NO')
	else:
		print('YES')


n = int(input())
d = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(n):
	input()
	s = input()
	flag = True
	for i in range(len(s) // 2):
		if s[i] == 'a':
			if s[len(s) - i - 1] == 'z':
				if d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26]:
					flag = False
			elif d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26] and d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26]:
				flag = False
		elif s[i] == 'z':
			if s[len(s) - i - 1] == 'a':
				if d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26]:
					flag = False
			elif d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26] and d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26]:
				flag = False
		elif s[len(s) - i - 1] == 'a':
			if s[i] == 'z':
				if d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26]:
					flag = False
			elif d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26] and d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26]:
				flag = False
		elif s[len(s) - i - 1] == 'z':
			if s[i] == 'a':
				if d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26]:
					flag = False
			elif d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26] and d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26]:
				flag = False
		elif d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26] and d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26] and (d[(d.find(s[i]) + 1) % 26] != d[(d.find(s[len(s) - i - 1]) - 1) % 26]) and (d[(d.find(s[i]) - 1) % 26] != d[(d.find(s[len(s) - i - 1]) + 1) % 26]):
			flag = False
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	k = 0
	for i in range(len(s) // 2):
		if s[i] != s[len(s) - i - 1]:
			if chr(ord(s[i]) + 1) == chr(ord(s[len(s) - i - 1]) - 1):
				k += 1
			elif chr(ord(s[i]) - 1) == chr(ord(s[len(s) - i - 1]) - 1):
				k += 1
			elif chr(ord(s[i]) + 1) == chr(ord(s[len(s) - i - 1]) + 1):
				k += 1
			elif chr(ord(s[i]) - 1) == chr(ord(s[len(s) - i - 1]) + 1):
				k += 1
		else:
			k += 1
	if k == len(s) // 2:
		print('YES')
	else:
		print('NO')


T = int(input().strip())
out = []
for i in range(T):
	n = int(input().strip())
	s = input().strip()
	flag = True
	for i in range(n):
		if s[i] != s[n - 1 - i] and abs(ord(s[i]) - ord(s[n - 1 - i])) != 2:
			out.append('NO')
			flag = False
			break
	if flag:
		out.append('YES')
print('\n'.join(out))


def convert(a):
	if a == 97:
		return (98, True)
	elif a == 122:
		return (121, True)
	else:
		return (a, False)

def check(string):
	if len(string) == 1 or len(string) == 0:
		return True
	(first, fchange) = convert(ord(string[0]))
	(second, schange) = convert(ord(string[-1]))
	if fchange and schange:
		if first == second:
			return check(string[1:-1])
		else:
			return False
	elif fchange or schange:
		if abs(first - second) == 1:
			return check(string[1:-1])
		else:
			return False
	elif abs(first - second) in [0, 2]:
		return check(string[1:-1])
	else:
		return False
n = int(input())
for x in range(n):
	length = int(input())
	mystr = input().strip()
	if check(mystr):
		print('YES')
	else:
		print('NO')


l1 = int(input())
while l1 > 0:
	l1 -= 1
	l2 = int(input())
	l3 = list(input())
	n = l3.__len__()
	a = True
	for i in range(int(n / 2)):
		x = abs(ord(l3[i]) - ord(l3[n - i - 1]))
		if not (x == 0 or x == 2):
			a = False
			print('NO')
			break
	if a:
		print('YES')


t = int(input())

def find(s):
	r = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(26):
		if r[i] == s:
			return i
while t:
	n = int(input())
	r = input()
	e = 0
	for i in range(n // 2):
		if abs(find(r[i]) - find(r[-i - 1])) > 2 or abs(find(r[i]) - find(r[-i - 1])) == 1:
			print('NO')
			e = 1
			break
	if e == 0:
		print('YES')
	t = t - 1


t = int(input())
for i in range(t):
	f = 1
	n = int(input())
	a = str(input())
	for j in range(n):
		if a[j] == a[n - 1 - j] or ord(a[j]) - ord(a[n - 1 - j]) == 2 or ord(a[j]) - ord(a[n - 1 - j]) == -2:
			z = 0
		else:
			f = 0
			break
	if f == 1:
		print('YES')
	else:
		print('NO')


def can_do_it(n, s):
	lim = n // 2
	a = s[:lim]
	b = s[lim:][::-1]
	for i in range(lim):
		if a[i] != b[i] and abs(ord(a[i]) - ord(b[i])) != 2:
			return False
	return True

def main():
	n_tests = int(input())
	results = [''] * n_tests
	for i in range(n_tests):
		n = int(input())
		s = input()
		results[i] = 'YES' if can_do_it(n, s) else 'NO'
	print('\n'.join(results))
main()


t = int(input())
for _ in range(t):
	n = int(input())
	l = input()
	c = 0
	for i in range(n // 2):
		if l[i] == l[n - i - 1]:
			c += 1
		elif abs(ord(l[i]) - ord(l[n - i - 1])) == 2:
			c += 1
	if c == n // 2:
		print('YES')
	else:
		print('NO')


n = int(input())
for x in range(n):
	l = int(input())
	s = input()
	for i in range(l // 2):
		o1 = ord(s[i])
		o2 = ord(s[l - i - 1])
		diff = abs(o1 - o2)
		if diff != 2 and diff != 0:
			print('NO')
			break
	else:
		print('YES')


l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
hash = {}
for i in range(26):
	hash[l[i]] = i + 1
t = int(input())
for i in range(t):
	n = int(input())
	k = input()
	x = 0
	y = n - 1
	flag = 0
	while x != n // 2 + 1 and y != n - n // 2 - 1:
		if abs(hash[k[x]] - hash[k[y]]) == 2 or abs(hash[k[x]] - hash[k[y]]) == 0:
			x += 1
			y -= 1
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
	else:
		print('NO')


numCases = int(input())
for i in range(numCases):
	n = int(input())
	s = input()
	pal = False
	for i in range(n // 2):
		endI = -i - 1
		if ord(s[i]) == ord(s[endI]) or ord(s[i]) - 1 == ord(s[endI]) + 1 or ord(s[i]) + 1 == ord(s[endI]) - 1:
			pal = True
		else:
			pal = False
			break
	print('YES' if pal else 'NO')


dic_pos = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
dic_let = {0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f', 6: 'g', 7: 'h', 8: 'i', 9: 'j', 10: 'k', 11: 'l', 12: 'm', 13: 'n', 14: 'o', 15: 'p', 16: 'q', 17: 'r', 18: 's', 19: 't', 20: 'u', 21: 'v', 22: 'w', 23: 'x', 24: 'y', 25: 'z'}

def check(letterA, letterB):
	if letterA == letterB:
		return True
	else:
		if dic_pos[letterB] + 1 in dic_let:
			if dic_pos[letterA] + 1 in dic_let:
				if dic_let[dic_pos[letterB] + 1] == dic_let[dic_pos[letterA] + 1]:
					return True
			if dic_pos[letterA] - 1 in dic_let:
				if dic_let[dic_pos[letterB] + 1] == dic_let[dic_pos[letterA] - 1]:
					return True
		if dic_pos[letterB] - 1 in dic_let:
			if dic_pos[letterA] + 1 in dic_let:
				if dic_let[dic_pos[letterB] - 1] == dic_let[dic_pos[letterA] + 1]:
					return True
			if dic_pos[letterA] - 1 in dic_let:
				if dic_let[dic_pos[letterB] - 1] == dic_let[dic_pos[letterA] - 1]:
					return True
		return False

def palindromic_switch():
	cases = int(input())
	length = []
	arrays = []
	for i in range(cases):
		length.append(int(input()))
		arrays.append(input())
	for i in range(len(arrays)):
		if len(arrays[i]) == 2:
			if check(arrays[i][0], arrays[i][1]):
				print('YES')
			else:
				print('NO')
		else:
			x = 0
			yes = True
			while x < int(len(arrays[i]) / 2):
				if check(arrays[i][x], arrays[i][-(1 + x)]):
					x += 1
				else:
					yes = False
					break
			if yes:
				print('YES')
			else:
				print('NO')
palindromic_switch()


for _ in range(int(input().strip())):
	n = int(input().strip())
	s = input().strip()
	i = 0
	j = n - 1
	ans = 'YES'
	if s == s[::-1]:
		print(ans)
	else:
		while i < j:
			if abs(ord(s[i]) - ord(s[j])) != 2 and abs(ord(s[i]) - ord(s[j])) != 0:
				ans = 'NO'
				break
			i += 1
			j -= 1
		print(ans)


def solve(s):
	for k in range(int(len(s) / 2)):
		if abs(ord(s[k]) - ord(s[-1 - k])) not in [0, 2]:
			return 'NO'
	return 'YES'
T = int(input())
for i in range(T):
	a = input()
	s = input()
	print(solve(s))


T = int(input())
for t in range(T):
	n = int(input())
	s = list(input())
	ok = True
	for i in range(n // 2):
		d = abs(ord(s[i]) - ord(s[-i - 1]))
		if d > 2 or d == 1:
			ok = False
	print(['NO', 'YES'][ok])


def ehPalindromoTwist(word, size):
	metade = size // 2
	i = 0
	ehPalindromoTwist = True
	while i < metade and ehPalindromoTwist:
		if word[i] != word[size - i - 1]:
			numAscii1 = ord(word[i])
			numAscii2 = ord(word[size - i - 1])
			c1 = {numAscii1 - 1, numAscii1, numAscii1 + 1}
			c2 = {numAscii2 - 1, numAscii2, numAscii2 + 1}
			resultado = c1.intersection(c2)
			cond1 = len(resultado) > 0
			cond2 = numAscii1 not in resultado
			cond3 = numAscii2 not in resultado
			ehPalindromoTwist = cond1 and cond2 and cond3
		i += 1
	return ehPalindromoTwist
n = int(input())
for i in range(n):
	size = int(input())
	word = str(input())
	resp = ehPalindromoTwist(word, size)
	if resp:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	s = input()
	final = ''
	flag = 0
	for i in range(len(s) // 2):
		if abs(ord(s[i]) - ord(s[len(s) - i - 1])) not in [0, 2]:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')


t = int(input())
for cases in range(t):
	n = int(input())
	s = input()
	flag = 1
	for i in range(0, n // 2 + 1):
		if ord(s[i]) - ord(s[n - i - 1]) != 0 and abs(ord(s[i]) - ord(s[n - i - 1])) != 2:
			flag = 0
			break
	if flag:
		print('YES')
	else:
		print('NO')


def main():
	for _ in range(int(input())):
		(_, s) = (input(), input())
		print(('NO', 'YES')[all((ord(a) - ord(b) in (-2, 0, 2) for (a, b) in zip(s, s[::-1])))])
main()


T = int(input())
for _ in range(T):
	N = int(input())
	S = input()
	t = 1
	for i in range(N // 2):
		temp = abs(ord(S[i]) - ord(S[N - 1 - i]))
		if temp == 0 or temp == 2:
			continue
		else:
			t = -1
			break
	if t == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(k, l) = (int(input()), list(input()))
	h = set([abs(ord(l[j]) - ord(l[k - 1 - j])) for j in range(k // 2)])
	print(['NO', 'YES'][h in [{0}, {2}, {0, 2}]])


def canBePal(s):
	sr = s[::-1]
	for k in range(int(len(s) / 2)):
		d = abs(ord(s[k]) - ord(sr[k]))
		if d == 1 or d > 2:
			return False
	return True
n = int(input())
for k in range(n):
	input()
	if canBePal(input()):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	for i in range(n // 2):
		a = ord(s[i])
		b = ord(s[-i - 1])
		if a + 1 != b + 1 and a + 1 != b - 1 and (a - 1 != b + 1):
			print('NO')
			break
	else:
		print('YES')


def decrement(a):
	return chr(ord(a) - 1)

def increment(a):
	return chr(ord(a) + 1)
t = int(input())
for i in range(t):
	n = int(input())
	string = input()
	stringrev = string[::-1]
	flag = 1
	n = len(string)
	for j in range(0, len(string) // 2):
		if string[j] != stringrev[j] and increment(string[j]) != decrement(stringrev[j]) and (decrement(string[j]) != increment(stringrev[j])):
			flag = 0
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


import string
T = int(input())
lower = string.ascii_lowercase
lettermap = dict()
for i in range(26):
	lettermap[lower[i]] = i
for t in range(T):
	n = int(input())
	s = input()
	for i in range(n // 2):
		tmp = abs(lettermap[s[i]] - lettermap[s[n - 1 - i]])
		if tmp != 2 and tmp != 0:
			print('NO')
			break
	else:
		print('YES')


n = int(input())
for i in range(n):
	m = int(input())
	b = 'abcdefghijklmnopqrstuvwxyz'
	l = list(input())
	c = 0
	for i in range(m // 2):
		r = l[i]
		p = l[-(i + 1)]
		t = b.index(r)
		y = b.index(p)
		if p == r or abs(t - y) == 2:
			continue
		else:
			c += 1
			print('NO')
			break
	if c == 0:
		print('YES')


numero_entradas = int(input())
while numero_entradas > 0:
	boolean = 0
	tamanho = int(input())
	metade = int(tamanho / 2)
	string = input()
	string_aux = string[:metade]
	for i in range(len(string_aux)):
		comeco = ord(string[i]) - ord('a')
		fim = ord(string[tamanho - i - 1]) - ord('a')
		decrementa_1 = comeco - 1
		incrementa_1 = comeco + 1
		decrementa_2 = fim - 1
		incrementa_2 = fim + 1
		if decrementa_1 != decrementa_2 and decrementa_1 != incrementa_2 and (incrementa_1 != decrementa_2) and (incrementa_1 != incrementa_2):
			boolean = 1
	if boolean:
		print('NO')
	else:
		print('YES')
	numero_entradas -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(input())
	count = 0
	for i in range(n // 2):
		if abs(ord(a[i]) - ord(a[-i - 1])) == 0 or abs(ord(a[i]) - ord(a[-i - 1])) == 2:
			count = 0
		else:
			count = 1
			break
	if count == 0:
		print('YES')
	else:
		print('NO')


from __future__ import division, print_function
from collections import *
from math import *
from itertools import *
from time import time
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	n = int(input())
	s = input()
	if s == s[::-1]:
		print('YES')
		return
	opposite = s[::-1]
	for i in range(n // 2):
		first = ord(s[i])
		second = ord(opposite[i])
		if first == second:
			continue
		if first - 1 == second + 1:
			continue
		if first + 1 == second - 1:
			continue
		else:
			print('NO')
			return
	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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
while t:
	main()
	t -= 1


T = int(input())
for cc in range(0, T):
	n = int(input())
	s = input()
	for i in range(0, n):
		diff = abs(ord(s[i]) - ord(s[n - 1 - i]))
		if diff != 0 and diff != 2:
			print('NO')
			break
	else:
		print('YES')


s = '1abcdefghijklmnopqrstuvwxyz2'

def check(x, y):
	try:
		if s[s.index(x) - 1] == s[s.index(y) + 1] or s[s.index(x) - 1] == s[s.index(y) - 1] or s[s.index(x) + 1] == s[s.index(y) - 1] or (s[s.index(x) + 1] == s[s.index(y) + 1]):
			return 1
		else:
			return 0
	except:
		if x == 'a' and y == 'z' or (x == 'z' and y == 'a'):
			return 0
		elif x == 'z':
			if s[s.index(x) - 1] == s[s.index(y) + 1] or s[s.index(x) - 1] == s[s.index(y) - 1] or 'a' == s[s.index(y) - 1] or ('a' == s[s.index(y) + 1]):
				return 1
			else:
				return 0
		elif y == 'z':
			if s[s.index(x) - 1] == 'a' or s[s.index(x) - 1] == s[s.index(y) - 1] or s[s.index(x) + 1] == s[s.index(y) - 1] or (s[s.index(x) + 1] == 'a'):
				return 1
			else:
				return 0
q = int(input())
for i in range(q):
	n = int(input()) // 2
	s1 = input()
	r = 1
	f = s1[:n]
	m = s1[n:][::-1]
	for j in range(n):
		if f[j] != m[j]:
			if not check(f[j], m[j]):
				r = 0
				print('NO')
				break
	if r:
		print('YES')


number_inputs = int(input())
for i in range(number_inputs):
	length = int(input())
	half = length // 2
	string = input()
	is_pal = True
	aux = 1
	for k in range(half, length):
		first_letter = ord(string[k])
		second_letter = ord(string[half - aux])
		distance = abs(first_letter - second_letter)
		if distance > 2 or distance == 1:
			is_pal = False
			break
		aux += 1
	if is_pal:
		print('YES')
	else:
		print('NO')


def solve():
	n = int(input())
	s = input()
	e = ord('a')
	(a, b) = (s[:n // 2], s[n // 2:])
	b = b[::-1]
	for (x, y) in zip(a, b):
		i = ord(x) - e
		j = ord(y) - e
		if abs(i - j) == 0 or abs(i - j) == 2:
			continue
		print('NO')
		return
	print('YES')
for _ in range(int(input())):
	solve()


n = int(input())
for i in range(n):
	m = int(input())
	s = input()
	flag = True
	for i in range(m // 2):
		if abs(ord(s[i]) - ord(s[m - i - 1])) != 0 and abs(ord(s[i]) - ord(s[m - i - 1])) != 2:
			flag = False
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	s = input()
	x = n // 2
	for i in range(x + 1):
		if ord(s[i]) + 1 == ord(s[-i - 1]) + 1 or ord(s[i]) + 1 == ord(s[-i - 1]) - 1 or ord(s[i]) - 1 == ord(s[-i - 1]) - 1 or (ord(s[i]) - 1 == ord(s[-i - 1]) + 1):
			pass
		else:
			break
	if i == x:
		print('YES')
	else:
		print('NO')
	t -= 1


import string

def change_palindrome(n, s):
	ref = string.ascii_lowercase
	first = s[:n // 2]
	sec = list(reversed(s[n // 2:]))
	if first == sec:
		return 'YES'
	else:
		comb = list(zip(first, sec))
		for (i, j) in comb:
			if i != j:
				for y in range(26):
					if y <= 23:
						if ref[y] == i or ref[y] == j:
							if ref[y + 2] != i and ref[y + 2] != j:
								return 'NO'
							else:
								break
					else:
						return 'NO'
		return 'YES'
t = int(input())
ans = []
for x in range(t):
	n = int(input())
	s = input()
	ans.append(change_palindrome(n, s))
for u in ans:
	print(u)


import string

def solve(case):
	global dic
	global qtd
	flag = 0
	for i in range(qtd):
		for j in dic[case[i]]:
			if j in dic[case[-1 - i]]:
				flag = 1
				break
		if flag == 0:
			return 'NO'
		else:
			flag = 0
	return 'YES'
letters = list(string.ascii_lowercase)
dic = {'a': [1], 'b': [0, 2]}
for i in range(2, 25):
	dic[letters[i]] = [dic[letters[i - 1]][0] + 1, dic[letters[i - 1]][1] + 1]
dic['z'] = [24]
for i in range(int(input())):
	qtd = int(input()) // 2
	case = input()
	print(solve(case))


n = int(input())
for i in range(n):
	x = int(input())
	s = str(input())
	r = s[::-1]
	b = True
	for i in range(0, x):
		if s[i] != r[i] and abs(ord(s[i]) - ord(r[i])) != 2:
			b = False
			break
	if b:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	k = int(input())
	p = list(input())
	n = 0
	for i in range(k // 2):
		if p[i] == p[k - i - 1] or ord(p[i]) + 2 == ord(p[k - i - 1]) or ord(p[i]) - 2 == ord(p[k - i - 1]):
			n += 1
	print('YES' if n == k // 2 else 'NO')


for t in range(int(input().strip())):
	n = int(input().strip())
	s = input().strip()
	x = n // 2
	for i in range(x):
		if abs(ord(s[i]) - ord(s[n - i - 1])) not in [0, 2]:
			print('NO')
			break
	else:
		print('YES')


T = int(input())
for _ in range(T):
	n = int(input())
	line = input()
	answer = 'YES'
	for i in range(n // 2):
		if line[i] != line[n - i - 1] and abs(ord(line[i]) - ord(line[n - i - 1])) != 2:
			answer = 'NO'
			break
	print(answer)


def is_palindrome(s):
	ans = True
	left = 0
	right = len(s) - 1
	while left < right:
		if s[left] == 'a' and s[right] == 'a' or (s[left] == 'z' and s[right] == 'z'):
			pass
		elif s[left] == 'a' and s[right] == 'z' or (s[left] == 'z' and s[right] == 'a'):
			ans = False
			break
		elif s[left] == 'a' and s[right] != 'c' or (s[right] == 'a' and s[left] != 'c'):
			ans = False
			break
		elif s[left] == 'z' and s[right] != 'x' or (s[right] == 'z' and s[left] != 'x'):
			ans = False
			break
		else:
			possible = False
			if ord(s[left]) + 1 == ord(s[right]) + 1:
				possible = True
			elif ord(s[left]) + 1 == ord(s[right]) - 1:
				possible = True
			elif ord(s[left]) - 1 == ord(s[right]) + 1:
				possible = True
			elif ord(s[left]) - 1 == ord(s[right]) - 1:
				possible = True
			if not possible:
				ans = False
				break
		left += 1
		right -= 1
	return ans
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	ans = is_palindrome(s)
	if ans:
		print('YES')
	else:
		print('NO')


n = int(input())
while n > 0:
	x = int(input())
	data = list(input())
	i = 0
	stat = 'YES'
	while i < len(data):
		if stat == 'NO':
			break
		if data[i] != data[len(data) - i - 1]:
			temp = list()
			temp.append(chr(ord(data[i]) + 1))
			temp.append(chr(ord(data[i]) - 1) if data[i] != 'a' else '')
			temp.append(chr(ord(data[len(data) - i - 1]) + 1) if data[len(data) - i - 1] != 'z' else '')
			temp.append(chr(ord(data[len(data) - i - 1]) - 1))
			temp = sum([1 for x in temp if temp.count(x) > 1])
			if temp == 0:
				stat = 'NO'
				break
		i += 1
	print(stat)
	n -= 1


from sys import exit
from math import *

def next(c):
	if c == 'z':
		exit(-1)
	return ord(c) + 1 - ord('a')

def prev(c):
	if c == 'a':
		exit(-1)
	return ord(c) - 1 - ord('a')
t = int(input())
for _ in range(t):
	n = int(input())
	s = input().strip()
	for (a, b) in zip(s[:n // 2], s[::-1][:n // 2]):
		na = float('NaN')
		nb = float('NaN')
		pa = float('NaN')
		pb = float('NaN')
		if a != 'z':
			na = next(a)
		if b != 'z':
			nb = next(b)
		if a != 'a':
			pa = prev(a)
		if b != 'a':
			pb = prev(b)
		if not (na == nb or na == pb or pa == nb or (pa == pb)):
			break
	else:
		print('YES')
		continue
	print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	s2 = s[::-1]
	fail = False
	for i in range(len(s)):
		diff = abs(ord(s[i]) - ord(s2[i]))
		if diff and diff != 2:
			print('NO')
			fail = True
			break
	if not fail:
		print('YES')


HAPPY_END = 0
NON_HAPPY_END = -2
DELTA = 1

def main(a):
	for i in range(a):
		check_string()

def check_string():
	length = int(input())
	s = input()
	if ispol(s, length) == HAPPY_END:
		print('YES')
	else:
		print('NO')

def ispol(s, length):
	for i in range(length // 2):
		diff = abs(ord(s[i]) - ord(s[length - i - 1]))
		if diff and diff != 2 * DELTA:
			return NON_HAPPY_END
	return HAPPY_END
num = int(input())
main(num)


t = int(input())
for i in range(t):
	n = int(input())
	t = input()
	flag = 1
	for i in range(n // 2):
		if ord(t[i]) - 1 == ord(t[n - i - 1]) - 1 or ord(t[i]) - 1 == ord(t[n - i - 1]) + 1 or ord(t[i]) + 1 == ord(t[n - i - 1]) - 1 or (ord(t[i]) + 1 == ord(t[n - i - 1]) + 1):
			flag = 1
		else:
			flag = 0
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


def convert(c):
	if c == 'a':
		return ('b', 'b')
	if c == 'z':
		return ('y', 'y')
	return (chr(ord(c) + 1), chr(ord(c) - 1))
for _ in range(int(input())):
	n = int(input())
	s = input()
	(i, j) = (0, n - 1)
	while i < j:
		(a, b) = (convert(s[i]), convert(s[j]))
		if not (b[0] in a or b[1] in a):
			print('NO')
			break
		i += 1
		j -= 1
	else:
		print('YES')


a = int(input())
b = [None] * a
s = [None] * a
for i in range(0, a):
	b[i] = int(input())
	s[i] = input()
for i in range(0, a):
	for j in range(1, b[i] // 2 + 1):
		d = 0
		if ord(s[i][j - 1]) - 1 == ord(s[i][b[i] - j]) - 1:
			d = 1
		elif ord(s[i][j - 1]) - 1 == ord(s[i][b[i] - j]) + 1:
			d = 1
		elif ord(s[i][j - 1]) + 1 == ord(s[i][b[i] - j]) - 1:
			d = 1
		elif ord(s[i][j - 1]) + 1 == ord(s[i][b[i] - j]) + 1:
			d = 1
		else:
			print('NO')
			d = 0
			break
	if d == 1:
		print('YES')


t = int(input())
for tc in range(t):
	n = int(input())
	s = input()
	ans = 'YES'
	for i in range(n // 2):
		if not (s[i] == s[n - i - 1] or abs(ord(s[i]) - ord(s[n - i - 1])) == 2):
			ans = 'NO'
			break
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	for j in range(n // 2 + 1):
		if n % 2 != 0 and j == n // 2:
			break
		else:
			d1 = ord(a[j])
			d2 = ord(a[n - 1 - j])
			if d1 + 1 != d2 + 1 and d1 - 1 != d2 + 1 and (d1 + 1 != d2 - 1) and (d1 - 1 != d2 - 1):
				print('NO')
				j = -1
				break
	if j != -1:
		print('YES')


n = int(input())
for i in range(n):
	k = 0
	l = int(input())
	m = input()
	s = ''.join(reversed(m))
	for i in range(len(m)):
		if abs(ord(s[i]) - ord(m[i])) == 2 or abs(ord(s[i]) - ord(m[i])) == 0:
			k += 1
	if k == len(s):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = [x for x in s]
	i = 0
	j = len(s) - 1
	while i < j:
		if ord(l[i]) - ord(l[j]) != 0 and ord(l[i]) - ord(l[j]) != 2 and (ord(l[i]) - ord(l[j]) != -2):
			print('NO')
			break
		i = i + 1
		j = j - 1
	if i > j:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	string = input()
	flag = True
	for j in range(n // 2):
		d = abs(ord(string[j]) - ord(string[-j - 1]))
		if d > 2 or d % 2 == 1:
			flag = False
			break
	if flag == True:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	string = str(input())
	flag = 0
	for i in range(0, n // 2):
		diff = abs(ord(string[i]) - ord(string[~i]))
		if diff == 1 or diff > 2:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')


t = int(input())

def get_str(s):
	next = ''
	prev = ''
	if s == 'a':
		next = chr(ord(s) + 1)
	elif s == 'z':
		prev = chr(ord(s) - 1)
	else:
		next = chr(ord(s) + 1)
		prev = chr(ord(s) - 1)
	return next + prev

def canPalindrome(n, s):
	options = []
	for i in range(n // 2):
		a = get_str(s[i])
		b = get_str(s[-1 * i - 1])
		l = len(options) // 2
		options.insert(l, a)
		options.insert(l + 1, b)
	for i in range(n // 2):
		if not len(''.join(set(options[i]).intersection(set(options[-1 * i - 1])))) > 0:
			return False
	return True
res = []
for i in range(t):
	n = int(input())
	s = input()
	res.append(canPalindrome(n, s))
for i in res:
	if i == True:
		print('YES')
	else:
		print('NO')


import bisect
import os
import gc
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def main():
	for _ in range(iin()):
		n = iin()
		s = sin()
		flag = 1
		for i in range(0, n // 2):
			if s[i] != s[~i]:
				if s[i] == 'a' and s[~i] == 'z':
					flag = 0
					break
				elif s[i] == 'z' and s[~i] == 'a':
					flag = 0
					break
				elif abs(ord(s[i]) - ord(s[~i])) != 2:
					flag = 0
					break
		if flag:
			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()


t = int(input())
for i in range(t):
	n = int(input())
	st = input()
	flag = True
	for i in range(n // 2):
		diff = abs(ord(st[i]) - ord(st[n - i - 1]))
		if diff != 2 and diff != 0:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	m = int(input())
	s = input()
	flag = True
	for i in range(m // 2):
		if s[i] == s[m - i - 1] or abs(ord(s[i]) - ord(s[m - 1 - i])) == 2:
			flag = True
		else:
			flag = False
			break
	if flag == True:
		print('YES')
	else:
		print('NO')


def move(c):
	if c == 'a':
		return ['b']
	elif c == 'z':
		return ['y']
	return [chr(ord(c) - 1), chr(ord(c))]

def solve(s):
	l = 0
	r = len(s) - 1
	while l < r:
		d = abs(ord(s[l]) - ord(s[r]))
		if not (d == 0 or d == 2):
			return False
		l += 1
		r -= 1
	return True
n = int(input())
for i in range(n):
	l = input()
	s = input()
	if solve(s):
		print('YES')
	else:
		print('NO')


t = int(input())

def pal(n, s):
	x = 0
	for i in range(int(n / 2)):
		if ord(s[i]) + 1 == ord(s[n - 1 - i]) + 1 or ord(s[i]) - 1 == ord(s[n - 1 - i]) - 1 or ord(s[i]) - 1 == ord(s[n - 1 - i]) + 1 or (ord(s[i]) + 1 == ord(s[n - 1 - i]) - 1):
			x += 1
	if x == int(n / 2):
		print('YES')
	else:
		print('NO')
for j in range(t):
	n = int(input())
	s = input()
	pal(n, s)


class pari:

	def __init__(self, pre, suc):
		self.pre = pre
		self.suc = suc

def equa(a, b):
	if a.pre == b.pre or a.suc == b.suc or a.pre == b.suc or (a.suc == b.pre):
		return True
	else:
		return False
s = 'abcdefghijklmnopqrstuvwxyz'
l = list(s)
d = {}
d[l[0]] = pari('1', 'b')
d[l[25]] = pari('y', '2')
for i in range(1, 25):
	d[l[i]] = pari(l[i - 1], l[i + 1])
for p in range(int(input())):
	n = int(input())
	a = input()
	f = True
	for i in range(int(n / 2) + n % 2):
		if equa(d[a[i]], d[a[n - 1 - i]]) == False:
			f = False
			break
	if f:
		print('YES')
	else:
		print('NO')


t = int(input())
a = [input() for i in range(2 * t)]
for i in range(t):
	n = int(a[2 * i])
	s = a[2 * i + 1]
	f = 0
	for i in range(n // 2):
		res = abs(ord(s[i]) - ord(s[n - i - 1]))
		if res != 0 and res != 2:
			f = 1
	if f == 1:
		print('NO')
	else:
		print('YES')


N = int(input())
for i in range(N):
	input()
	X = input()
	(first, last) = (0, len(X) - 1)
	Flag = True
	while first < last:
		if not (ord(X[first]) + 1 == ord(X[last]) + 1 or ord(X[first]) - 1 == ord(X[last]) - 1 or ord(X[first]) - 1 == ord(X[last]) + 1 or (ord(X[first]) + 1 == ord(X[last]) - 1)):
			Flag = False
			break
		first += 1
		last -= 1
	print('YES' if Flag else 'NO')


i = input
t = int(i())
while t:
	t -= 1
	i()
	a = [*map(ord, i())]
	print('YNEOS'[1 - all((abs(x - y) in {0, 2} for (x, y) in zip(a, a[::-1])))::2])


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	i = 0
	j = n - 1
	while i < j:
		if s[i] != s[j]:
			first = ord(s[i])
			second = ord(s[j])
			fir_lis = [chr(first - 1), chr(first + 1)]
			sec_lis = {chr(second - 1), chr(second + 1)}
			for elm in fir_lis:
				if elm in sec_lis:
					break
			else:
				print('NO')
				break
		i += 1
		j -= 1
	else:
		print('YES')


n = int(input())
for j in range(n):
	t = 0
	l = int(input())
	x = input()
	for i in range(l // 2):
		if abs(ord(x[i]) - ord(x[l - 1 - i])) == 2 or abs(ord(x[i]) - ord(x[l - 1 - i])) == 0:
			t = t + 1
		else:
			break
	if t == l // 2:
		print('YES')
	else:
		print('NO')


n_test = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'

def get_idx(letter, alphabet):
	for (letter_idx, alphabet_letter) in enumerate(alphabet):
		if letter == alphabet_letter:
			return letter_idx

def check_proximity(letter_a, letter_b, alphabet):
	idx_a = get_idx(letter_a, alphabet)
	idx_b = get_idx(letter_b, alphabet)
	difference = abs(idx_a - idx_b)
	if difference == 2 or difference == 0:
		return True
	return False
answer_log = [''] * n_test
for i in range(n_test):
	n_letters = int(input())
	letter_sequence = input()
	is_pallindrome = True
	half_len = n_letters // 2
	for controller in range(half_len):
		are_near = check_proximity(letter_sequence[controller], letter_sequence[n_letters - controller - 1], alphabet)
		if not are_near:
			is_pallindrome = False
			break
	if is_pallindrome:
		answer_log[i] = 'YES'
	else:
		answer_log[i] = 'NO'
for answer in answer_log:
	print(answer)


t = int(input())
while t:
	t = t - 1
	l = int(input())
	s = input()
	i = 0
	j = l - 1
	flag = 0
	while i < j:
		if s[i] == s[j]:
			i = i + 1
			j = j - 1
		elif abs(ord(s[j]) - ord(s[i])) == 2:
			i = i + 1
			j = j - 1
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for h in range(t):
	n = int(input())
	s = input()
	f = True
	for i in range(len(s) // 2):
		if ord(s[i]) - ord(s[len(s) - 1 - i]) == 2 or ord(s[len(s) - 1 - i]) - ord(s[i]) == 2 or ord(s[len(s) - 1 - i]) == ord(s[i]):
			f == True
		else:
			f = False
			break
	if f == False:
		print('NO')
	else:
		print('YES')


T = int(input())
for i in range(T):
	n = int(input())
	s = input()
	length = n // 2
	cnt = 0
	for j in range(length):
		chr1 = ord(s[len(s) - 1 - j])
		chr0 = ord(s[j])
		if chr0 - 1 == chr1 + 1 or chr0 - 1 == chr1 - 1 or chr0 + 1 == chr1 + 1 or (chr0 + 1 == chr1 - 1):
			cnt += 1
		else:
			print('NO')
			break
	if cnt == length:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = [0, 2]
	c = 0
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - i - 1])) not in l:
			c = 1
			break
	print('YNEOS'[c::2])


t = int(input())
tt = t
arr_n = []
arr_s = []
i = 0
while i < t:
	arr_n.append(int(input()))
	arr_s.append(input())
	i += 1
k = 0
while k < tt:
	flag = True
	i = 0
	while 2 * i < arr_n[k]:
		if ord(arr_s[k][i]) == ord(arr_s[k][arr_n[k] - 1 - i]) or ord(arr_s[k][i]) - ord(arr_s[k][arr_n[k] - 1 - i]) == 2 or ord(arr_s[k][arr_n[k] - 1 - i]) - ord(arr_s[k][i]) == 2:
			i += 1
			continue
		flag = False
		i += 1
	k += 1
	print('YES' if flag == True else 'NO')


x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
n = int(input())
xxx = []
for i in range(n):
	m = int(input())
	z = list(map(str, input()))
	(j, k) = (0, m - 1)
	ans = 'YES'
	while j != m / 2:
		if abs(x.index(z[j]) - x.index(z[k])) > 2 or abs(x.index(z[j]) - x.index(z[k])) == 1:
			ans = 'NO'
			break
		j += 1
		k -= 1
	xxx.append(ans)
for i in xxx:
	print(i)


tc = int(input())
for i in range(tc):
	n = int(input())
	a = input()
	(e, k) = ([], 0)
	for t in range(n):
		e.append(ord(a[t]))
	for t in range(n):
		if e[t] == e[n - 1 - t] or e[t] - 1 == e[n - 1 - t] - 1 or e[t] + 1 == e[n - 1 - t] - 1 or (e[t] - 1 == e[n - 1 - t] + 1) or (e[t] + 1 == e[n - 1 - t] + 1):
			continue
		else:
			k = 1
			print('NO')
			break
	if k == 0:
		print('YES')


t = int(input())
while t:
	n = int(input()) // 2
	s = input()
	f = True
	for i in range(n):
		d = abs(ord(s[i]) - ord(s[-i - 1]))
		if not (d == 2 or d == 0):
			f = False
			break
	print('YES' if f else 'NO')
	t -= 1


import sys
sys.stdin.readline()
sys.stdin.readline()
for line in sys.stdin:
	line = line.strip()
	sys.stdin.readline()
	temp = False
	for i in range(len(line)):
		dis = abs(ord(line[i]) - ord(line[len(line) - 1 - i]))
		if dis == 0 or dis == 2:
			temp = True
		else:
			temp = False
			print('NO')
			break
	if temp:
		print('YES')


def palindrome(length, word):
	j = 0
	flag = 'No'
	if word == word[::-1]:
		flag = 'YES'
	else:
		while j <= length / 2 - 1:
			if ord(word[j]) - 1 == ord(word[length - 1 - j]) - 1 or ord(word[j]) + 1 == ord(word[length - 1 - j]) - 1 or ord(word[j]) - 1 == ord(word[length - 1 - j]) + 1 or (ord(word[j]) + 1 == ord(word[length - 1 - j]) + 1):
				flag = 'YES'
			else:
				flag = 'NO'
				break
			j = j + 1
	print(flag)
x = int(input())
i = 1
if x == 0:
	print('NO')
while i <= x:
	j = int(input())
	word = list(input())
	palindrome(j, word)
	i = i + 1


t = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
for q in range(t):
	n = int(input())
	a = input()
	ans = True
	for i in range(n):
		chek = abs(alph.find(a[i]) - alph.find(a[n - 1 - i]))
		if not (chek == 2 or chek == 0):
			ans = False
			break
	if ans:
		print('YES')
	else:
		print('NO')


def check_pal(s, n):
	for i in range(n // 2):
		if s[i] == 'a' and s[n - i - 1] == 'a' or (s[i] == 'a' and s[n - i - 1] == 'c') or (s[i] == 'c' and s[n - i - 1] == 'a'):
			continue
		if s[i] == 'z' and s[n - i - 1] == 'z' or (s[i] == 'z' and s[n - i - 1] == 'x') or (s[i] == 'x' and s[n - i - 1] == 'z'):
			continue
		if abs(ord(s[i]) - ord(s[n - i - 1])) != 2 and abs(ord(s[i]) - ord(s[n - i - 1])) != 0:
			return False
	return True
t = int(input())
for z in range(t):
	n = int(input())
	s = input()
	if check_pal(s, n):
		print('YES')
	else:
		print('NO')


def func(n, s):
	i = 0
	j = n - 1
	while i < j:
		a = set()
		if s[i] == 'z':
			a.add('a')
		else:
			a.add(str(ord(s[i]) + 1))
		if s[i] == 'a':
			a.add('z')
		else:
			a.add(str(ord(s[i]) - 1))
		if s[j] == 'z':
			a.add('a')
		else:
			a.add(str(ord(s[j]) + 1))
		if s[j] == 'a':
			a.add('z')
		else:
			a.add(str(ord(s[j]) - 1))
		if len(list(a)) < 4:
			i += 1
			j -= 1
			continue
		else:
			return 'NO'
	return 'YES'
t = int(input())
while t:
	t = t - 1
	n = int(input())
	s = input()
	print(func(n, s))


t = int(input())
while t:
	n = int(input())
	s = input()
	fg = 0
	for i in range(n // 2):
		if not abs(ord(s[i]) - ord(s[-i - 1])) in [0, 2]:
			fg = 1
			break
	print('YNEOS'[fg == 1::2])
	t -= 1


testcase = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
alphabet_inverse = {}
for i in range(len(alphabet)):
	alphabet_inverse[alphabet[i]] = i

def getRange(ch):
	if ch == 'a':
		return {'b'}
	elif ch == 'z':
		return {'y'}
	else:
		index = alphabet_inverse[ch]
		return {alphabet[index - 1], alphabet[index + 1]}
for _ in range(testcase):
	n = int(input())
	s = input()
	status = True
	for i in range(n):
		(leftrange, rightrange) = (getRange(s[i]), getRange(s[-i - 1]))
		substatus = False
		for ch1 in leftrange:
			for ch2 in rightrange:
				if ch1 == ch2:
					substatus = True
					break
		if not substatus:
			status = False
			break
	if status:
		print('YES')
	else:
		print('NO')


t = int(input())
alfie = 'abcdefghijklmnopqrstuvwxyz'
for x in range(t):
	n = int(input())
	s0 = list(input())
	s1 = list(s0)
	s1.reverse()
	ruined = 0
	for x in range(n):
		potato = abs(alfie.index(s0[x]) - alfie.index(s1[x]))
		if potato in [0, 2]:
			pass
		else:
			ruined = 1
			break
	if ruined:
		print('NO')
	else:
		print('YES')


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

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

def si():
	return str(input())

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

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

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

def fsi():
	return str(stdin.readline())

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

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

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

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)
t = ii()
for a0 in range(t):
	n = ii()
	s = si()
	f = 0
	for i in range(n // 2):
		if abs(ord(s[i]) - ord(s[n - 1 - i])) == 0 or abs(ord(s[i]) - ord(s[n - 1 - i])) == 2:
			f += 1
	if f == n // 2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	ok = False
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			if s[i] == 'a':
				if s[n - i - 1] != 'c':
					ok = True
					break
			if s[i] == 'z':
				if s[n - i - 1] != 'x':
					ok = True
					break
			if abs(ord(s[i]) - ord(s[n - i - 1])) != 2:
				ok = True
				break
	if ok:
		print('NO')
	else:
		print('YES')


T = int(input())
for test in range(T):
	l = int(input())
	s = input()
	s1 = s[:l // 2][::-1]
	s2 = s[l // 2:]
	ok = True
	for i in range(l // 2):
		c1 = ord(s1[i])
		c2 = ord(s2[i])
		if len(set([c1 - 1, c1 + 1, c2 - 1, c2 + 1])) == 4:
			ok = False
			break
	print('YES' if ok else 'NO')


def containSameAdjacent(a, b):
	return a == b or abs(ord(a) - ord(b)) == 2

def checkPalindromKentang(a):
	l = a[:int(len(a) / 2)]
	r = a[int(len(a) / 2) + (0 if len(a) % 2 == 0 else 1):][::-1]
	t = True
	for i in range(len(l)):
		t = t and containSameAdjacent(l[i], r[i])
	return t
inputs = [(input(), input()) for x in range(int(input()))]
for iis in inputs:
	s = iis[1]
	print('YES' if checkPalindromKentang(s) else 'NO')


import math
import sys
import re

def palindrome(n, s):
	if s == s[::-1]:
		return 'YES'
	if n % 2 == 0:
		for x in range(n // 2):
			if abs(ord(s[:n // 2][x]) - ord(s[n // 2:][n // 2 - x - 1])) != 0 and abs(ord(s[:n // 2][x]) - ord(s[n // 2:][n // 2 - x - 1])) != 2:
				return 'NO'
		return 'YES'
for x in range(int(input())):
	n = int(input())
	s = input()
	print(palindrome(n, s))


import math
test = int(input())
for _ in range(test):
	n = int(input())
	s = input()
	t = s[::-1]
	if s == t:
		print('YES')
		continue
	elif n == 1 or n == 2:
		if n == 1:
			print('YES')
			continue
		if n == 2:
			if abs(ord(s[1]) - ord(s[0])) == 2:
				print('YES')
				continue
			else:
				print('NO')
		if s.count(s[0]) == n:
			print('YES')
			continue
	else:
		i = 0
		j = n - 1
		c = 0
		while i <= j:
			if s[i] == s[j]:
				c += 1
			elif abs(ord(s[i]) - ord(s[j])) == 2:
				c += 1
			i = i + 1
			j = j - 1
		if c == math.ceil(n / 2):
			print('YES')
		else:
			print('NO')


t = input()
for z in range(int(t)):
	l = int(input())
	st = input()
	fl = True
	for i in range(int(l / 2)):
		s = abs(ord(st[i]) - ord(st[l - i - 1]))
		if s > 2 or s == 1:
			fl = False
			break
	if fl:
		print('YES')
	else:
		print('NO')


from math import ceil as c
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(ord, input()))
	x = c(n / 2)
	for i in range(x):
		if a[i] == a[n - 1 - i] or abs(a[i] - a[n - 1 - i]) == 2:
			flag = 0
		else:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')


T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	flag = 'YES'
	for i in range(len(s) // 2):
		if s[i] != s[len(s) - 1 - i] and abs(ord(s[i]) - ord(s[len(s) - 1 - i])) != 2:
			flag = 'NO'
			break
	print(flag)


n = int(input())
ta = list('abcdefghijklmnopqrstuvwxyz')
for x in range(n):
	ma = []
	c = 0
	na = int(input())
	p = list(input())
	la = len(p)
	if la % 2 == 0:
		tl = p[0:la // 2]
		pa = p[la // 2:]
		for item in tl:
			ma.append(ta.index(item) + 1)
		for item in pa:
			ma.append(ta.index(item) + 1)
		l = len(ma) - 1
		f = 0
		for x in range(len(ma) // 2):
			if abs(ma[f] - ma[l]) == 2 or abs(ma[f] - ma[l]) == 0:
				f += 1
				l -= 1
			else:
				c = 1
				print('NO')
				break
		if c == 0:
			print('YES')
	elif la % 2 != 0:
		tl = p[0:la // 2]
		pa = p[la // 2 + 1:]
		for item in ta:
			ma.append(ta.index(item) + 1)
		for item in pa:
			ma.append(ta.index(item) + 1)
		l = len(ma) - 1
		f = 0
		for x in range(len(ma) // 2):
			if abs(ma[f] - ma[l]) == 2 or abs(ma[f] - ma[l]) == 0:
				f += 1
				l -= 1
			else:
				c = 1
				print('NO')
				break
		if c == 0:
			print('YES')


T = int(input())
x = 0
for i in range(T):
	n = int(input())
	s = input()
	for j in range(n // 2):
		tmp = abs(ord(s[j]) - ord(s[len(s) - (j + 1)]))
		if tmp == 1 or tmp > 2:
			x = 1
	else:
		print('YES' if x == 0 else 'NO')
	x = 0


n = int(input())
for _ in range(n):
	input()
	s = input()
	for i in range(len(s) // 2):
		val = abs(ord(s[i]) - ord(s[-1 - i]))
		if val != 0 and val != 2:
			print('NO')
			break
	else:
		print('YES')


def get_problem_data():
	global n, m, s, t
	M = lambda : list(map(int, input().split()))
	n = int(input())
	s = input()

def solve(s):
	r = s[:len(s) // 2]
	w = s[len(s) // 2:]
	w = w[::-1]
	for i in range(len(w)):
		if abs(ord(w[i]) - ord(r[i])) > 2 or abs(ord(w[i]) - ord(r[i])) == 1:
			print('NO')
			break
	else:
		print('YES')
m = int(input())
for i in range(m):
	get_problem_data()
	solve(s)


for _ in [0] * int(input()):
	n = int(input())
	a = input()
	print('YNEOS'[any((x != y and abs(ord(x) - ord(y)) != 2 for (x, y) in zip(a, a[::-1])))::2])


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	ind = True
	for j in range(n // 2):
		if s[j] != s[n - j - 1] and abs(ord(s[j]) - ord(s[n - j - 1])) != 2:
			print('NO')
			ind = False
			break
	if ind == True:
		print('YES')


def intervall(letter):
	if letter == 'a':
		return ['b']
	elif letter == 'z':
		return ['y']
	else:
		return [chr(ord(letter) - 1), chr(ord(letter) + 1)]
n = int(input())
for i in range(n):
	leng = int(input())
	palstr = input()
	ans = False
	for i in range(leng // 2 + 1):
		ans = False
		for letter in intervall(palstr[i]):
			if letter in intervall(palstr[leng - i - 1]):
				ans = True
		if not ans:
			print('NO')
			break
	if ans:
		print('YES')


kol = int(input())
dop = {0, 2, -2}
for i in range(0, kol):
	n = int(input())
	s = input()
	mark = True
	for j in range(0, n // 2):
		if not s.encode(encoding='utf-8')[j] - s.encode(encoding='utf-8')[n - j - 1] in dop:
			mark = False
			break
	if mark:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	flag = True
	n = int(input())
	s = input()
	s1 = s[:len(s) // 2]
	s2 = s[len(s) // 2:]
	s2 = s2[::-1]
	for i in range(len(s2)):
		if abs(ord(s1[i]) - ord(s2[i])) != 2 and abs(ord(s1[i]) - ord(s2[i])) != 0:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')
	t -= 1


def canbe(c, s):
	for i in range(int(c / 2), c):
		if abs(ord(s[i]) - ord(s[c - i - 1])) > 2 or abs(ord(s[i]) - ord(s[c - i - 1])) == 1:
			return False
	return True
t = int(input())
buf = []
for i in range(t):
	c = int(input())
	s = input()
	if canbe(c, s):
		buf.append('YES')
	else:
		buf.append('NO')
for el in buf:
	print(el)


n = int(input())
for i in range(n):
	t = int(input())
	word = input()
	k = 0
	l = t - 1
	ans = True
	while k < l:
		v = abs(ord(word[k]) - ord(word[l]))
		if v > 2 or v == 1:
			ans = False
			break
		k += 1
		l -= 1
	print('YES') if ans else print('NO')


t = int(input())
while t > 0:
	n = int(input())
	a = input()
	i = 0
	j = n - 1
	f = 1
	while i <= j:
		x = abs(ord(a[i]) - ord(a[j]))
		if x != 0 and x != 2:
			f = 0
			break
		i += 1
		j -= 1
	if f == 0:
		print('NO')
	else:
		print('YES')
	t -= 1


def checkpal(str):
	k = len(str)
	flag = 1
	for i in range(k):
		a = ord(str[i])
		b = ord(str[k - 1 - i])
		if abs(a - b) != 2 and abs(a - b) != 0:
			flag = 0
	return flag
T = input()
T = int(T)
if 1 <= T <= 50:
	while T != 0:
		n = input()
		n = int(n)
		if n < 2 or n > 100 or n % 2 != 0:
			break
		else:
			str = input()
			if len(str) == n:
				if checkpal(str) == 1:
					print('YES')
				else:
					print('NO')
		T = T - 1


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	k = (n + 1) // 2 - 1
	j = 0
	f = 0
	while j <= k:
		if abs(ord(s[j]) - ord(s[n - 1 - j])) == 2 or abs(ord(s[j]) - ord(s[n - 1 - j])) == 0:
			pass
		else:
			f = 1
			break
		j += 1
	if f == 1:
		print('NO')
	else:
		print('YES')


testcases = int(input())
r = 0
l = []
while testcases > r:
	length_of_word = int(input())
	word = input()
	a = 0
	if length_of_word % 2 == 0:
		while a < length_of_word / 2:
			if chr(ord(word[a]) + 1) == chr(ord(word[length_of_word - 1 - a]) + 1) or chr(ord(word[a]) - 1) == chr(ord(word[length_of_word - 1 - a]) + 1) or chr(ord(word[a]) + 1) == chr(ord(word[length_of_word - 1 - a]) - 1) or (chr(ord(word[a]) - 1) == chr(ord(word[length_of_word - 1 - a]) - 1)):
				x = 1
			else:
				x = 0
				break
			a = a + 1
	r = r + 1
	if x == 0:
		l.append('NO')
	if x == 1:
		l.append('YES')
s = 0
while s < testcases:
	print(l[s])
	s = s + 1


k = int(input())
for j in range(k):
	n = int(input())
	a = input()
	for i in range(n // 2):
		f = True
		if abs(ord(a[i]) - ord(a[n - 1 - i])) > 2 or abs(ord(a[i]) - ord(a[n - 1 - i])) == 1:
			f = False
			break
	print('YES' if f else 'NO')


p = int(input())
result = []
for q in range(p):
	n = int(input())
	pal = input()
	j = 0
	for i in range(0, n // 2):
		m = abs(ord(pal[i]) - ord(pal[n - i - 1]))
		if m == 2 or m == 0:
			j += 1
	if j == n // 2:
		result.append('YES')
		continue
	else:
		result.append('NO')
		continue
print(*result)


T = int(input())
for i in range(T):
	N = int(input())
	text = input()
	L = []
	check = True
	for item in text:
		L.append(ord(item) - ord('a'))
	for j in range(N):
		if abs(L[j] - L[N - j - 1]) != 2 and abs(L[j] - L[N - j - 1]) != 0:
			check = False
			break
	if check:
		print('YES')
	else:
		print('NO')


a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(int(input())):
	n = int(input())
	s = input()
	en = 0
	flag = True
	for i in range(n // 2):
		en = n - i - 1
		indst = a.index(s[i])
		inden = a.index(s[en])
		if s[i] != s[en]:
			if abs(indst - inden) > 2 or abs(indst - inden) == 1:
				flag = False
	if flag == True:
		print('YES')
	else:
		print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

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

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	t = I()
	aa = [[I(), S()] for _ in range(t)]
	r = []
	for (n, s) in aa:
		f = 1
		for i in range(n // 2):
			k = abs(ord(s[i]) - ord(s[-1 - i]))
			if k not in [0, 2]:
				f = 0
				break
		if f:
			r.append('YES')
		else:
			r.append('NO')
	return '\n'.join(r)
print(main())


T = int(input())
for i in range(T):
	I = int(input())
	s = input()
	p = True
	for j in range(I // 2):
		c = ord(s[j]) - ord(s[I - 1 - j])
		if c != 2 and c != -2 and (c != 0):
			p = False
			break
	print('YES' if p else 'NO')


import math
n = input()
bang = 'abcdefghijklmnopqrstuvwxyz'
list = []
for i in range(int(n)):
	x = input()
	st = input()
	list.append(st)
for chuoi in list:
	for i in range(len(chuoi)):
		if i - len(chuoi) / 2 > 0:
			print('YES')
			break
		if chuoi[i] != chuoi[len(chuoi) - 1 - i]:
			if abs(bang.index(chuoi[i]) - bang.index(chuoi[len(chuoi) - 1 - i])) != 2:
				print('NO')
				break
		if len(chuoi) - i == 1:
			print('YES')


def esquerda(a):
	if a == 'a':
		return direita(a)
	return chr(ord(a) - 1)

def direita(a):
	if a == 'z':
		return esquerda(a)
	return chr(ord(a) + 1)

def equal(a, b):
	if a == b:
		return True
	A = esquerda(a)
	B = direita(b)
	if A == B:
		return True
	A = direita(a)
	B = esquerda(b)
	return A == B

def isPossible(string, chars):
	for i in range(0, len(string) // 2):
		if not equal(string[i], string[chars - 1 - i]):
			return False
	return True

def solve():
	string = []
	chars = int(input())
	string = input()
	print('YES' if isPossible(string, chars) else 'NO')
T = int(input())
for i in range(0, T):
	solve()


n = int(input())
for i in range(n):
	m = int(input())
	S = input()
	iP = True
	for i in range(m // 2):
		if abs(ord(S[i]) - ord(S[m - 1 - i])) == 0 or abs(ord(S[i]) - ord(S[m - 1 - i])) == 2:
			continue
		else:
			iP = False
			break
	if iP:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	a = True
	for i in range(n // 2):
		x = ord(s[i])
		y = ord(s[n - i - 1])
		if abs(x - y) == 2 or abs(x - y) == 0:
			pass
		else:
			a = False
	if a:
		print('YES')
	else:
		print('NO')


L = int(input())
result = []
alfa = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}
alfaC = {-1: None, 0: None, 1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z', 27: None, 28: None}
for f in range(L):
	checa = True
	input()
	s = list(input().lower())
	for i in range(round(len(s) / 2)):
		if s[i] == s[len(s) - i - 1] or s[len(s) - i - 1] == alfaC[alfa[s[i]] + 2]:
			continue
		elif s[len(s) - i - 1] == alfaC[alfa[s[i]] - 2]:
			continue
		else:
			checa = False
			break
	if checa:
		result.append('YES')
	else:
		result.append('NO')
for i in range(len(result)):
	print(result[i])


T = int(input())

def sol():
	N = int(input())
	s = input()
	for i in range(int(N / 2)):
		a = []
		b = []
		a1 = ord(s[i]) - 1 - ord('a')
		if a1 >= 0 and a1 <= ord('z'):
			a.append(a1)
		a2 = ord(s[i]) + 1 - ord('a')
		if a2 >= 0 and a2 <= ord('z'):
			a.append(a2)
		b1 = ord(s[-1 * (i + 1)]) - 1 - ord('a')
		if b1 >= 0 and b1 <= ord('z'):
			b.append(b1)
		b2 = ord(s[-1 * (i + 1)]) + 1 - ord('a')
		if b2 >= 0 and b2 <= ord('z'):
			b.append(b2)
		flag = False
		for aa in a:
			for bb in b:
				if aa == bb:
					flag = True
		if not flag:
			return False
	return True
for t in range(T):
	ans = sol()
	print('YES' if ans else 'NO')


from itertools import permutations
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	n = int(input())
	s = input()
	d = 1
	for i in range(n // 2):
		t = abs(ord(s[i]) - ord(s[-i - 1]))
		if t != 2 and t != 0:
			d = 0
			break
	if d:
		print('YES')
	else:
		print('NO')


T = int(input())
N = [None] * T
S = [None] * T
for i in range(T):
	N[i] = int(input())
	S[i] = input()
for i in range(T):
	check = 1
	for j in range(N[i] // 2):
		if abs(ord(S[i][j]) - ord(S[i][-j - 1])) != 2 and abs(ord(S[i][j]) - ord(S[i][-j - 1])) != 0:
			check = 0
	if check == 1:
		print('YES')
	else:
		print('NO')


T = int(input())
while T != 0:
	n = int(input())
	s = input()
	s1 = s[:n // 2]
	s2 = s[n // 2:]
	tmp = []
	for i in range(n // 2):
		tmp.append(abs(ord(s1[i]) - ord(s2[n // 2 - i - 1])))
	tmp = [i != 2 and i != 0 for i in tmp]
	if any(tmp):
		print('NO')
	else:
		print('YES')
	T -= 1


t = int(input())
for i in range(t):
	n = int(input())
	string = input()
	j = 0
	temp = ord(string[j])
	right = ord(string[n - 1 - j])
	res = abs(temp - right)
	while j < n // 2 and (res == 0 or res == 2):
		j += 1
		temp = ord(string[j])
		right = ord(string[n - 1 - j])
		res = abs(temp - right)
	if j == n // 2:
		print('YES')
	else:
		print('NO')


import string
lettres = list(string.ascii_lowercase)
from math import *

def sim(a, b):
	lista = []
	listb = []
	similaire = False
	if a == 'a':
		lista.append('b')
	elif a == 'z':
		lista.append('y')
	elif lettres.index(a) in range(1, 25):
		lista.append(lettres[lettres.index(a) - 1])
		lista.append(lettres[lettres.index(a) + 1])
	if b == 'a':
		listb.append('b')
	elif b == 'z':
		listb.append('y')
	elif lettres.index(b) in range(1, 25):
		listb.append(lettres[lettres.index(b) - 1])
		listb.append(lettres[lettres.index(b) + 1])
	for i in lista:
		if i in listb:
			similaire = True
	return similaire
t = int(input(''))
lens = []
strs = []
sol = []
compteur = 0
for i in range(t):
	lens.append(int(input('')))
	strs.append(list(input('')))
for i in strs:
	for j in range(floor(len(i) / 2)):
		if not sim(i[j], i[-j - 1]):
			compteur += 1
	if compteur != 0:
		sol.append('NO')
	else:
		sol.append('YES')
	compteur = 0
for i in sol:
	print(i)


for _ in range(int(input())):
	n = int(input())
	a = input()
	p = sum(list(map(lambda x, y: 0 if abs(ord(x) - ord(y)) == 0 or abs(ord(x) - ord(y)) == 2 else 1, a[:n // 2], a[n // 2:n][::-1])))
	print('NO' if p else 'YES')


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	z = int(n / 2)
	f = n - 1
	c = 0
	for i in range(z):
		if s[i] == 'a':
			if s[f - i] == 'a':
				c = c + 1
				continue
		if s[i] == 'z':
			if s[f - i] == 'z':
				c = c + 1
				continue
		d = ord(s[i]) - ord(s[f - i])
		d = abs(d)
		if d == 0 or d == 2:
			c = c + 1
	if c == z:
		print('YES')
	else:
		print('NO')
	t = t - 1


t = int(input())
for _ in range(t):
	n = int(input())
	string = input()
	i = 0
	j = n - 1
	end = n // 2
	possible = True
	while i < end:
		if ord(string[i]) + 1 == ord(string[j]) + 1 or ord(string[i]) - 1 == ord(string[j]) + 1 or ord(string[i]) - 1 == ord(string[j]) - 1 or (ord(string[i]) + 1 == ord(string[j]) - 1):
			i += 1
			j -= 1
		else:
			possible = False
			break
	if possible:
		print('YES')
	else:
		print('NO')


t = int(input())
ans = []
while t:
	n = int(input())
	s = input()
	l = []
	c = 0
	for i in range(int(n / 2)):
		l.append(abs(ord(s[i]) - ord(s[n - i - 1])))
		c = c + 1
	if l.count(0) + l.count(2) == c:
		ans.append('YES')
	else:
		ans.append('NO')
	t = t - 1
print('\n'.join(ans))