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 C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace AtCoderPractice
{
    class Program
    {


        /// <summary>
        /// 順列 (n >= k)
        /// </summary>
        public static long nPk(long n, long k)
        {
            if (n < k) return 0;
            if (n == k) return 1;

            long x = 1;
            for (long i = 0; i < k; i++)
            {
                x = x * (n - i);
            }
            return x;
        }

        /// <summary>
        /// 組み合わせ (n >= k)
        /// </summary>
        public static long nCk(long n, long k)
        {
            if (n < k) return 0;
            if (n == k) return 1;

            long x = 1;
            for (long i = 0; i < k; i++)
            {
                x = x * (n - i) / (i + 1);
            }
            return x;
        }

        const string AZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        static void Main(string[] args)
        {
            var r = "";
            var b = false;
            var count = 0;
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 処理


            




            var v = StandardInputToString();
            var half1 = v.Substring(0, (v.Length - 1) / 2);
            var half2 = v.Substring((v.Length + 3) / 2 - 1);



            b = isKaibun(v) && isKaibun(half1) && isKaibun(half2);



            // 処理

            Console.WriteLine($"{(b ? "Yes" : "No")}");

            // 処理終了
            Console.Out.Flush();
            Console.ReadKey();
        }

        static bool isKaibun(string v)
        {
            int i = v.Length - 1;
            foreach(var c in v)
            {
                if(c != v[i])
                {
                    return false;
                }
                i--;
            }

            return true;
        }

        public static decimal Sqrt(decimal x, decimal? guess = null)
        {
            var ourGuess = guess.GetValueOrDefault(x / 2m);
            var result = x / ourGuess;
            var average = (ourGuess + result) / 2m;

            if (average == ourGuess) // This checks for the maximum precision possible with a decimal.
                return average;
            else
                return Sqrt(x, average);
        }

        #region 標準処理ライブラリ
        /// <summary>
        /// 半角スペース区切りの標準入力を文字列のIListに変換します。
        /// </summary>
        /// <returns></returns>
        static public IList<string> StandardInputToStrings()
        {
            return Console.ReadLine().Split(' ').ToList();
        }

        /// <summary>
        /// stringを取得
        /// </summary>
        /// <returns></returns>
        static public string StandardInputToString()
        {
            return Console.ReadLine();
        }

        /// <summary>
        /// 半角スペース区切りの標準入力を文字列のIListに変換します。複数行に対応。
        /// </summary>
        /// <returns></returns>
        static public IList<IList<string>> MultipleStandardInputToStrings()
        {
            string line;
            var r = new List<List<string>>();
            do
            {
                line = Console.ReadLine();
                r.Add(line.Split(' ').ToList());
                line = Console.ReadLine();
            } while (line == null);

            return (IList<IList<string>>)r;
        }

        /// <summary>
        /// 半角スペース区切りの標準入力を数値のIListに変換します。
        /// </summary>
        /// <returns></returns>
        static public IList<long> StandardInputToLongs()
        {
            return Console.ReadLine().Split(' ').Select(n => long.Parse(n)).ToList();
        }
        /// <summary>
        /// 半角スペース区切りの標準入力を数値のIListに変換します。
        /// </summary>
        /// <returns></returns>
        static public long StandardInputToLong()
        {
            return long.Parse(Console.ReadLine());
        }

        /// <summary>
        /// 半角スペース区切りの標準入力を文字列のIListに変換します。複数行に対応。
        /// </summary>
        /// <returns></returns>
        static public IList<IList<long>> MultipleStandardInputToLongs()
        {
            string line;
            var r = new List<List<long>>();
            do
            {
                line = Console.ReadLine();
                r.Add(line.Split(' ').Select(n => long.Parse(n)).ToList());
                line = Console.ReadLine();
            } while (line == null);

            return (IList<IList<long>>)r;
        }

        /// <summary>
        /// 半角スペース区切りの標準入力を数値のIListに変換します。
        /// </summary>
        /// <returns></returns>
        static public IList<int> StandardInputToInts()
        {
            return Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToList();
        }
        /// <summary>
        /// 半角スペース区切りの標準入力を数値のIListに変換します。
        /// </summary>
        /// <returns></returns>
        static public int StandardInputToInt()
        {
            return int.Parse(Console.ReadLine());
        }

        /// <summary>
        /// 半角スペース区切りの標準入力を文字列のIListに変換します。複数行に対応。
        /// </summary>
        /// <returns></returns>
        static public IList<IList<int>> MultipleStandardInputToInts()
        {
            string line;
            var r = new List<List<int>>();
            do
            {
                line = Console.ReadLine();
                r.Add(line.Split(' ').Select(n => int.Parse(n)).ToList());
                line = Console.ReadLine();
            } while (line == null);

            return (IList<IList<int>>)r;
        }
    }






    public static class AtCoderResultExtentions
    {
        static public string AsDelimitedResult<T>(this IList<T> ie, string delimitter = " ")
        {
            return string.Join(delimitter, ie);
        }
    }
    #endregion
    #region List拡張
    public static class IListExtensions
    {


        public static IEnumerable<IEnumerable<T>> Perm<T>(this IEnumerable<T> items, int? k = null)
        {
            if (k == null)
                k = items.Count();

            if (k == 0)
            {
                yield return Enumerable.Empty<T>();
            }
            else
            {
                var i = 0;
                foreach (var x in items)
                {
                    var xs = items.Where((_, index) => i != index);
                    foreach (var c in Perm(xs, k - 1))
                        yield return c.Before(x);

                    i++;
                }
            }
        }
        public static IEnumerable<IEnumerable<T>> Comb<T>(this IEnumerable<T> items, int r)
        {
            if (r == 0)
            {
                yield return Enumerable.Empty<T>();
            }
            else
            {
                var i = 1;
                foreach (var x in items)
                {
                    var xs = items.Skip(i);
                    foreach (var c in Comb(xs, r - 1))
                        yield return c.Before(x);

                    i++;
                }
            }

        }

        // 要素をシーケンスに追加するユーティリティ
        public static IEnumerable<T> Before<T>(this IEnumerable<T> items, T first)
        {
            yield return first;

            foreach (var i in items)
                yield return i;
        }
        public static IList<T> Swap<T>(this IList<T> ie, int indexA, int indexB)
        {
            var temp = ie[indexA];
            ie[indexA] = ie[indexB];
            ie[indexB] = temp;
            return ie;
        }
    }
    #endregion
}