public static void main(String[] args) {
char[] character = { 'a', 'a', 'h', 'a', 'a' };
char[] stack = new char[10];
int top = -1;
int mid = character.length % 2 == 0 ? character.length / 2 - 1 : character.length / 2;
for (int i = 0; i <= mid; i++) {
top++;
stack[top] = character[i];
}
if (character.length % 2 == 0) {
mid++;
}
for (int i = mid; i < character.length; i++) {
if (top >= 0) {
if (stack[top] != character[i]) {
break;
}
}
top--;
}
if (top == -1) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}