# Kiem tra chuoi doi xung
import sys
sys.setrecursionlimit(100000)
def is_symmetric(s,i,j):
if i>=j:
return True
if s[i]!=s[j]:
return False
return is_symmetric(s,i+1,j-1)
n = int(input())
s = input()
print("YES" if is_symmetric(s,0,n-1) else "NO")