import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc char c[] = S.toCharArray(); c S.toCharArray() S.toCharArray S int N = S.length(); N S.length() S.length S int a = (N-1)/2; a (N-1)/2 (N-1) N 1 2 if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    } a!=1 a 1 {
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      } int i=0; int i=0; i 0 i < a i a i++ i++ i {        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      } {        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      } if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        } c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i] c[i] == c[a-1 -i] c[i] c i c[a-1 -i] c a-1 -i a-1 -i a 1 i c[a+1 +i] == c[N-1 -i] c[a+1 +i] c a+1 +i a+1 +i a 1 i c[N-1 -i] c N-1 -i N-1 -i N 1 i {
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          } c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i] c[a-1 -i] == c[a+1 +i] c[a-1 -i] c a-1 -i a-1 -i a 1 i c[a+1 +i] c a+1 +i a+1 +i a 1 i c[i] == c[N-1 -i] c[i] c i c[N-1 -i] c N-1 -i N-1 -i N 1 i {
            
          } {
            System.out.println("No");
            return;
          } System.out.println("No") System.out.println System.out System System.out "No" return; {
          System.out.println("No");
          return;
        } System.out.println("No") System.out.println System.out System System.out "No" return; {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    } if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      } c[0]!=c[2] c[0] c 0 c[2] c 2 {
        System.out.println("No");
        return;
      } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String args[] args public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char c[] = S.toCharArray();
    int N = S.length();
    int a = (N-1)/2;
    if(a!=1){
      for(int i=0; i < a; i++){        
        if(c[i] == c[a-1 -i]&&c[a+1 +i] == c[N-1 -i]){
          if(c[a-1 -i] == c[a+1 +i]&&c[i] == c[N-1 -i]){
            
          } else {
            System.out.println("No");
            return;
          }
        } else {
          System.out.println("No");
          return;
        }
      }
    } else {
      if(c[0]!=c[2]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
}