작성
·
291
0
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Main main = new Main();
Scanner sc = new Scanner(System.in);
String s = sc.next();
String solution = main.solution(s);
System.out.println(solution);
}
public String solution(String str) {
String answer = "";
char[] chArr = str.toCharArray();
if (chArr.length % 2 == 1) {
return answer = "NO";
}
int lt = 0;
int rt = chArr.length - 1;
while (lt < rt) {
char startWord = Character.toUpperCase(chArr[lt]);
char lastWord = Character.toUpperCase(chArr[rt]);
if (!(startWord == lastWord)) {
return answer = "NO";
}
lt++;
rt--;
}
return answer = "YES";
}
}