S = eval(input())

N = len(S)





def f1(S):

    N = len(S)

    subset3 = S[0:(N - 2) // 2 + 1]

    subset4 = S[(N + 2) // 2:]

    return subset3, subset4





subset1, subset2 = f1(S)

_subset2 = ''.join(list(reversed(subset2)))

if subset1 != _subset2:

    print('No')

    exit()



if (N - 1) % 4 == 0:

    # print('subset1 2', subset1, subset2)

    subset3 = subset1[:((N - 1) // 4)]

    subset4 = subset1[((N - 1) // 4):]

    _subset4 = ''.join(list(reversed(subset4)))

    # print('subset3 4', subset3, subset4)

    subset5 = subset2[:((N - 1) // 4)]

    subset6 = subset2[((N - 1) // 4):]

    _subset6 = ''.join(list(reversed(subset6)))

    # print('subset5 6', subset5, subset6)

else:

    subset3, subset4 = f1(subset1)

    _subset4 = ''.join(list(reversed(subset4)))

    subset5, subset6 = f1(subset2)

    _subset6 = ''.join(list(reversed(subset6)))

if subset3 != _subset4:

    print('No')

    exit()

if subset5 != _subset6:

    print('No')

    exit()

print('Yes')

S = eval(input())

N = len(S)





def is_kaibun(s):

    _s = ''.join(list(reversed(s)))

    return s == _s





subset0 = S[0:(N - 2) // 2 + 1]

subset1 = S[(N + 2) // 2:]



ans = 'Yes' if is_kaibun(S) and is_kaibun(subset0) and is_kaibun(

    subset1) else 'No'

print(ans)

S = eval(input())
N = len(S)


def f1(S):
    N = len(S)
    subset3 = S[0 : (N - 2) // 2 + 1]
    subset4 = S[(N + 2) // 2 :]
    return subset3, subset4


subset1, subset2 = f1(S)
_subset2 = "".join(list(reversed(subset2)))
if subset1 != _subset2:
    print("No")
    exit()
if (N - 1) % 4 == 0:
    # print('subset1 2', subset1, subset2)
    subset3 = subset1[: ((N - 1) // 4)]
    subset4 = subset1[((N - 1) // 4) :]
    _subset4 = "".join(list(reversed(subset4)))
    # print('subset3 4', subset3, subset4)
    subset5 = subset2[: ((N - 1) // 4)]
    subset6 = subset2[((N - 1) // 4) :]
    _subset6 = "".join(list(reversed(subset6)))
    # print('subset5 6', subset5, subset6)
else:
    subset3, subset4 = f1(subset1)
    _subset4 = "".join(list(reversed(subset4)))
    subset5, subset6 = f1(subset2)
    _subset6 = "".join(list(reversed(subset6)))
if subset3 != _subset4:
    print("No")
    exit()
if subset5 != _subset6:
    print("No")
    exit()
print("Yes")

S = eval(input())
N = len(S)


def is_kaibun(s):
    _s = "".join(list(reversed(s)))
    return s == _s


subset0 = S[0 : (N - 2) // 2 + 1]
subset1 = S[(N + 2) // 2 :]
ans = "Yes" if is_kaibun(S) and is_kaibun(subset0) and is_kaibun(subset1) else "No"
print(ans)

-def f1(S): -    N = len(S) -    subset3 = S[0 : (N - 2) // 2 + 1] -    subset4 = S[(N + 2) // 2 :] -    return subset3, subset4 +def is_kaibun(s): +    _s = "".join(list(reversed(s))) +    return s == _s -subset1, subset2 = f1(S) -_subset2 = "".join(list(reversed(subset2))) -if subset1 != _subset2: -    print("No") -    exit() -if (N - 1) % 4 == 0: -    # print('subset1 2', subset1, subset2) -    subset3 = subset1[: ((N - 1) // 4)] -    subset4 = subset1[((N - 1) // 4) :] -    _subset4 = "".join(list(reversed(subset4))) -    # print('subset3 4', subset3, subset4) -    subset5 = subset2[: ((N - 1) // 4)] -    subset6 = subset2[((N - 1) // 4) :] -    _subset6 = "".join(list(reversed(subset6))) -    # print('subset5 6', subset5, subset6) -else: -    subset3, subset4 = f1(subset1) -    _subset4 = "".join(list(reversed(subset4))) -    subset5, subset6 = f1(subset2) -    _subset6 = "".join(list(reversed(subset6))) -if subset3 != _subset4: -    print("No") -    exit() -if subset5 != _subset6: -    print("No") -    exit() -print("Yes") +subset0 = S[0 : (N - 2) // 2 + 1] +subset1 = S[(N + 2) // 2 :] +ans = "Yes" if is_kaibun(S) and is_kaibun(subset0) and is_kaibun(subset1) else "No" +print(ans)