404649: GYM101604 A Almost Palindrome
Description
A string is considered palindrome if it's the same if you read it from the left or from the right (if it stays the same when you reverse it).
In this problem you are given a string, and your task is to swap 2 characters at different positions to make the string palindrome (note that you must do this step exactly once).
InputThe input contains just 1 line which is the string you are going to check, the string consists of at least 2 and at most 500,000 lower case English letters.
OutputPrint "YES" if you can make the given string palindrome by applying the above step exactly once, otherwise print "NO".
ExamplesInputabOutput
NOInput
abaOutput
YESInput
axaxOutput
YESNote
In the second test case, you can swap the first and last characters (which won't make any change), and the string will stay palindrome.
P.S. The judge is cute enough today and didn't allow strings with length 1.