#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, difference = 0, temp = 0;
  string s;
  cin >> s;
  double o = s.length();
  double g = ceil(o / 2);
  for (int i = 0; i < g; ++i) {
    n = s.length() - 1 - i;
    if (i == n) {
      temp = 1;
      continue;
    }
    if (s[i] == s[n])
      continue;
    else
      difference++;
  }
  if ((difference == 1 && temp == 0) || (difference == 0 && temp == 1) ||
      (difference == 1 && temp == 1))
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
