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(dead_code)]
mod utils {
    use std::io::{self, BufRead, BufReader, Stdin, StdinLock};
    use std::mem;
    use std::ops::{Deref, DerefMut};
    use std::str::{self, FromStr};

    pub struct Scanner<R: BufRead> {
        reader: R,
        buf: Vec<u8>,
    }

    impl<R: BufRead> Scanner<R> {
        pub fn new(reader: R) -> Scanner<R> {
            Scanner {
                reader: reader,
                buf: Vec::new(),
            }
        }

        pub fn read<T: FromStr>(&mut self) -> T {
            self.read_until(|&b| b == b' ' || b == b'\n');
            self.parse()
        }

        pub fn reads(&mut self) -> &str {
            self.read_until(|&b| b == b' ' || b == b'\n');
            unsafe { str::from_utf8_unchecked(&self.buf) }
        }

        pub fn readl(&mut self) -> &str {
            self.read_until(|&b| b == b'\n');
            unsafe { str::from_utf8_unchecked(&self.buf) }
        }

        pub fn read_vec<T: FromStr>(&mut self, count: usize) -> Vec<T> {
            let mut vec = Vec::with_capacity(count);

            for _ in 0..count {
                vec.push(self.read());
            }

            return vec;
        }

        fn read_until<P: FnMut(&u8) -> bool>(&mut self, mut predicate: P) {
            self.buf.clear();
            let mut first = true;

            // https://doc.rust-lang.org/src/std/io/mod.rs.html#1623-1649
            loop {
                let (done, used) = {
                    let available = self.reader.fill_buf().unwrap();
                    if first && available.len() == 0 {
                        panic!("EOF reached.");
                    }

                    match available.iter().position(&mut predicate) {
                        Some(0) if first => {
                            (false, 1)
                        }
                        Some(i) => {
                            self.buf.extend_from_slice(&available[..i]);
                            (true, i + 1)
                        }
                        None => {
                            self.buf.extend_from_slice(available);
                            (false, available.len())
                        }
                    }
                };

                self.reader.consume(used);
                if done || used == 0 {
                    return;
                }

                first = false;
            }
        }

        #[inline]
        fn parse<T: FromStr>(&mut self) -> T {
            // 文字列をT型へパースする
            let elem = unsafe { str::from_utf8_unchecked(&self.buf) };
            elem.parse()
                .unwrap_or_else(|_| panic!(format!("failed parsing: {}", elem)))
        }
    }

    pub struct StdinScanner {
        stdin: Stdin,
        scanner: Scanner<BufReader<StdinLock<'static>>>,
    }

    impl StdinScanner {
        pub fn new() -> StdinScanner {
            let stdin = io::stdin();
            let stdinlock = unsafe { mem::transmute(stdin.lock()) };
            let reader = BufReader::new(stdinlock);
            let scanner = Scanner::new(reader);
            StdinScanner {
                stdin: stdin,
                scanner: scanner,
            }
        }
    }

    impl Deref for StdinScanner {
        type Target = Scanner<BufReader<StdinLock<'static>>>;

        #[inline]
        fn deref(&self) -> &Self::Target {
            &self.scanner
        }
    }

    impl DerefMut for StdinScanner {
        #[inline]
        fn deref_mut(&mut self) -> &mut Self::Target {
            &mut self.scanner
        }
    }
}

fn is_kaibun(s: &str) -> bool {
    let n = s.len();
    let b = s.as_bytes();

    let mut i = 0;
    let mut j = n - 1;

    while i < j {
        if b[i] != b[j] {
            return false;
        }

        i += 1;
        j -= 1;
    }

    return true;
}

fn main() {
    let mut scanner = utils::StdinScanner::new();
    let s = scanner.readl();

    let result = is_kaibun(&s) && is_kaibun(&s[0..(s.len() - 1) / 2]) && is_kaibun(&s[(s.len() + 3) / 2 - 1..s.len()]);

    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}