
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	}

	public static boolean check1(ArrayList<String> a) {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	}

	public static boolean check2(ArrayList<String> a ) {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	}

	public static boolean check1(ArrayList<String> a) {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	}

	public static boolean check2(ArrayList<String> a ) {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	} main {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.nextLine(); S scan.nextLine() scan.nextLine scan String[] SArray = S.split(""); SArray S.split("") S.split S "" ArrayList<String> SList = new ArrayList<>(); SList new ArrayList<>() ArrayList<String> SList2 = new ArrayList<>(); SList2 new ArrayList<>() ArrayList<String> SList3 = new ArrayList<>(); SList3 new ArrayList<>() for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		} int i = 0; int i = 0; i 0 i<SArray.length i SArray.length SArray SArray.length i++ i++ i {
			SList.add(SArray[i]);
		} {
			SList.add(SArray[i]);
		} SList.add(SArray[i]) SList.add SList SArray[i] SArray i int a = SList.size(); a SList.size() SList.size SList for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		} int i = 0; int i = 0; i 0 i<(SList.size()-1)/2 i (SList.size()-1)/2 (SList.size()-1) SList.size() SList.size SList 1 2 i++ i++ i {
			SList2.add(SList.get(i));
		} {
			SList2.add(SList.get(i));
		} SList2.add(SList.get(i)) SList2.add SList2 SList.get(i) SList.get SList i for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		} int i = (SList.size()+3)/2-1; int i = (SList.size()+3)/2-1; i (SList.size()+3)/2-1 (SList.size()+3)/2 (SList.size()+3) SList.size() SList.size SList 3 2 1 i < a i a i++ i++ i {
			SList3.add(SList.get(i));
		} {
			SList3.add(SList.get(i));
		} SList3.add(SList.get(i)) SList3.add SList3 SList.get(i) SList.get SList i if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		} check1(SList) check1 SList {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		} if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			} SList2.size()%2==1 SList2.size()%2 SList2.size() SList2.size SList2 2 1 {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			} if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				} check1(SList2) check1 SList2 {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				} if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					} SList3.size()%2==1 SList3.size()%2 SList3.size() SList3.size SList3 2 1 {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					} if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						} check1(SList3) check1 SList3 {
							System.out.println("Yes");
						} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
							System.out.println("No");
						} System.out.println("No") System.out.println System.out System System.out "No" {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					} if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						} check2(SList3) check2 SList3 {
							System.out.println("Yes");
						} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
							System.out.println("No");
						} System.out.println("No") System.out.println System.out System System.out "No" {
					System.out.println("No");
				} System.out.println("No") System.out.println System.out System System.out "No" {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			} if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				} check2(SList2) check2 SList2 {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				} if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					} SList3.size()%2==1 SList3.size()%2 SList3.size() SList3.size SList3 2 1 {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					} if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						} check1(SList3) check1 SList3 {
							System.out.println("Yes");
						} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
							System.out.println("No");
						} System.out.println("No") System.out.println System.out System System.out "No" {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					} if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						} check2(SList3) check2 SList3 {
							System.out.println("Yes");
						} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
							System.out.println("No");
						} System.out.println("No") System.out.println System.out System System.out "No" {
					System.out.println("No");
				} System.out.println("No") System.out.println System.out System System.out "No" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String[] args args public static boolean check1(ArrayList<String> a) {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	} check1 {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	} for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		} int i = 0 ; int i = 0 ; i 0 i<(a.size()-1)/2 i (a.size()-1)/2 (a.size()-1) a.size() a.size a 1 2 i++ i++ i {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		} {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		} if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			} a.get(i).equals(a.get(a.size()-i-1)) == false a.get(i).equals(a.get(a.size()-i-1)) a.get(i).equals a.get(i) a.get a i a.get(a.size()-i-1) a.get a a.size()-i-1 a.size()-i-1 a.size() a.size a i 1 false {
				return false;
			} return false; false return true; true ArrayList<String> a a public static boolean check2(ArrayList<String> a ) {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	} check2 {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	} for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		} int i = 0; int i = 0; i 0 i<a.size()/2 i a.size()/2 a.size() a.size a 2 i++ i++ i {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		} {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		} if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			} a.get(i).equals(a.get(a.size()-i-1))==false a.get(i).equals(a.get(a.size()-i-1)) a.get(i).equals a.get(i) a.get a i a.get(a.size()-i-1) a.get a a.size()-i-1 a.size()-i-1 a.size() a.size a i 1 false {
				return false;
			} return false; false return true; true ArrayList<String> a a public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	}

	public static boolean check1(ArrayList<String> a) {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	}

	public static boolean check2(ArrayList<String> a ) {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	}
} public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	}

	public static boolean check1(ArrayList<String> a) {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	}

	public static boolean check2(ArrayList<String> a ) {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	}
} Main

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		String[] SArray = S.split("");
		ArrayList<String> SList = new ArrayList<>();
		ArrayList<String> SList2 = new ArrayList<>();
		ArrayList<String> SList3 = new ArrayList<>();

		for(int i = 0; i<SArray.length; i++) {
			SList.add(SArray[i]);
		}
		int a = SList.size();

		for(int i = 0; i<(SList.size()-1)/2; i++) {
			SList2.add(SList.get(i));
		}

		for(int i = (SList.size()+3)/2-1; i < a; i++){
			SList3.add(SList.get(i));
		}





		if(check1(SList)) {
			if(SList2.size()%2==1) {
				if(check1(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}else {
				if(check2(SList2)) {
					if(SList3.size()%2==1) {
						if(check1(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}else {
						if(check2(SList3)) {
							System.out.println("Yes");
						}else {
							System.out.println("No");
						}
					}
				}else {
					System.out.println("No");
				}
			}
		}else{
			System.out.println("No");
		};




	}

	public static boolean check1(ArrayList<String> a) {
		for(int i = 0 ; i<(a.size()-1)/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1)) == false){
				return false;
			}
		}
		return true;
	}

	public static boolean check2(ArrayList<String> a ) {
		for(int i = 0; i<a.size()/2; i++) {
			if(a.get(i).equals(a.get(a.size()-i-1))==false) {
				return false;
			}
		}
		return true;
	}
}