Problem:
Score : 200 points

Problem Statement

A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:

S is a palindrome.

Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.

The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.

Determine whether S is a strong palindrome.

Constraints

S consists of lowercase English letters.

The length of S is an odd number between 3 and 99 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

If S is a strong palindrome, print Yes;
otherwise, print No.

Sample Input 1

akasaka

Sample Output 1

Yes

S is akasaka.

The string formed by the 1-st through the 3-rd characters is aka.

The string formed by the 5-th through the 7-th characters is aka.
All of these are palindromes, so S is a strong palindrome.

Sample Input 2

level

Sample Output 2

No

Sample Input 3

atcoder

Sample Output 3

No

Solution in Rust (1.15.1) (judge verdict: Accepted)

#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::io::Read;
use std::io::{stdout, BufWriter, Write};

fn is_kaibun(a: &str) -> bool {
    //println!("{:?}",a);
    let a : Vec<char> = a.chars().collect();
    let length : usize = a.len();
    (0..length/2).map(|i| {
        //println!("{:?}",a[i] == a[length-1-i]);
        a[i] == a[length-1-i]
    }).fold(true, |sum, i| sum && i)
}

fn check_kaibun(a: &str) -> bool {
    if is_kaibun(a) == false {return false}
    let len = a.len();
    if ( is_kaibun(&a[..(len-1)/2]) == false || is_kaibun(&a[(len+3)/2-1..]) == false) {return false}
    return true
}
 
fn main() {
    let mut buf = String::new();
    
    let out = stdout();
    let mut out = BufWriter::new(out.lock());
 
    // 標準入力から全部bufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();
 
    // 読み込んだStringを空白で分解する
    let mut iter = buf.split_whitespace();
 
    let s: String = iter.next().unwrap().parse().unwrap();
    
    if check_kaibun(&s) {
        println!("Yes");
    } else {
        println!("No");
    }
    
}