import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int len = s.length();
        
        boolean first = true;
        boolean second = true;
        boolean third  = true;

        for(int i = 0; i < len; ++i){
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        }

        if(first) {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        }
        else System.out.println("No");  // そもそも回文でない


    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int len = s.length();
        
        boolean first = true;
        boolean second = true;
        boolean third  = true;

        for(int i = 0; i < len; ++i){
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        }

        if(first) {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        }
        else System.out.println("No");  // そもそも回文でない


    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int len = s.length();
        
        boolean first = true;
        boolean second = true;
        boolean third  = true;

        for(int i = 0; i < len; ++i){
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        }

        if(first) {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        }
        else System.out.println("No");  // そもそも回文でない


    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int len = s.length();
        
        boolean first = true;
        boolean second = true;
        boolean third  = true;

        for(int i = 0; i < len; ++i){
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        }

        if(first) {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        }
        else System.out.println("No");  // そもそも回文でない


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int len = s.length(); len s.length() s.length s boolean first = true; first true boolean second = true; second true boolean third  = true; third true for(int i = 0; i < len; ++i){
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        } int i = 0; int i = 0; i 0 i < len i len ++i ++i i {
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        } {
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        } if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            } s.charAt(i) == s.charAt(len - 1 - i) s.charAt(i) s.charAt s i s.charAt(len - 1 - i) s.charAt s len - 1 - i len - 1 - i len 1 i {
                first = true;
            } first = true first true {
                first = false;
                break;
            } first = false first false break; if(first) {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        }
        else System.out.println("No");  // そもそも回文でない first {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        } for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            } int i = 0; int i = 0; i 0 i < (len - 1) / 2 i (len - 1) / 2 (len - 1) len 1 2 ++i ++i i {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            } {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            } if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                } s.charAt(0) == s.charAt((len - 1) / 2 -1) s.charAt(0) s.charAt s 0 s.charAt((len - 1) / 2 -1) s.charAt s (len - 1) / 2 -1 (len - 1) / 2 (len - 1) len 1 2 1 second = true second true {
                    second = false;
                    break;
                } second = false second false break; if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない second {
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            } for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                } int i = (len + 3) / 2 - 1; int i = (len + 3) / 2 - 1; i (len + 3) / 2 - 1 (len + 3) / 2 (len + 3) len 3 2 1 i < len i len ++i ++i i {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                } {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                } if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    } s.charAt(i) == s.charAt(len - 1 - i) s.charAt(i) s.charAt s i s.charAt(len - 1 - i) s.charAt s len - 1 - i len - 1 - i len 1 i third = true third true {
                        third = false;
                        break;
                    } third = false third false break; if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない third System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" System.out.println("No") System.out.println System.out System System.out "No" System.out.println("No") System.out.println System.out System System.out "No" String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int len = s.length();
        
        boolean first = true;
        boolean second = true;
        boolean third  = true;

        for(int i = 0; i < len; ++i){
            if(s.charAt(i) == s.charAt(len - 1 - i)) {
                first = true;
            }
            else {
                first = false;
                break;
            }
        }

        if(first) {
            for(int i = 0; i < (len - 1) / 2; ++i) {
                if(s.charAt(0) == s.charAt((len - 1) / 2 -1)) second = true;
                else {
                    second = false;
                    break;
                }
            }
            if(second){
                for(int i = (len + 3) / 2 - 1; i < len; ++i) {
                    if(s.charAt(i) == s.charAt(len - 1 - i)) third = true;
                    else {
                        third = false;
                        break;
                    }
                }
                if(third) System.out.println("Yes");  // 強い回文である
                else System.out.println("No");  // 回文だが3つめの条件を満たさない

            }
            else System.out.println("No");  //回文だが, 2つめの条件を満たさない

        }
        else System.out.println("No");  // そもそも回文でない


    }
}