Problem:


Score : 200 points

Problem Statement

Given are a positive integer N and a string S of length N consisting of lowercase English letters.

Determine whether the string is a concatenation of two copies of some string.
That is, determine whether there is a string T such that S = T + T.

Constraints

1 \leq N \leq 100

S consists of lowercase English letters.

|S| = N

Input

Input is given from Standard Input in the following format:

N
S

Output

If S is a concatenation of two copies of some string, print Yes; otherwise, print No.

Sample Input 1

6
abcabc

Sample Output 1

Yes

Let T =  abc, and S = T + T.

Sample Input 2

6
abcadc

Sample Output 2

No

Sample Input 3

1
z

Sample Output 3

No



Sample input:
6
abcabc


Sample output:
Yes

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n%2 == 1:
    print('No')
else:
    for i in range(n//2):
        if not s[i] == s[i+n//2]:
            print('No')
            break
    else:
        print('Yes')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 == 0:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())

T = ''

for i in range(int(N/2)):
    T += S[i]

TT = T + T

if S == TT:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N == 1:
    print("No")
    exit()

for i in range(1,N):
    s1 = S[:i]
    s2 = S[i:]
    if s1 == s2 and len(s1)*2 == N:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())

if (N % 2) == 1:
    print("No")
else:
    num = N/2
    i = 0
    T1 = ""
    T2 = ""
    for val in S:
        i += 1
        if i > num:
            T2 += val
        else:
            T1 += val
    if T1 == T2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
#B
n = int(input())
s = list(input())
if n % 2 == 0:
    if s[:(n//2)] == s[(n//2):n]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
count = 0
#print(n)
if n%2==1:
    print("No")
else:
    for i in range(n//2):
        #print(s[i], s[n//2+i])
        if s[i]!=s[n//2+i]:
            count = 1
    if count == 0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())
s=input()
if n>1:
  q=n//2
  t1=s[:q]
  t2=s[q:]
  if t1==t2:
    print("Yes")
  else:
    print("No")
  
else:
  print("No")

Submission status: Accepted

Solution code:
input()
a=input()
if len(a)%2==0 and a[:len(a)//2]==a[len(a)//2:]:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    S = INPUT()

    if N%2 == 1:
        print("No")
    else:
        if S[:N//2] == S[N//2:]: print("Yes")
        else: print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()

print('Yes' if S[:N//2]==S[N//2:] else 'No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 != 0:
        print("No")
        exit()

tmp = N // 2

a1 = S[:tmp]
a2 = S[tmp:]

if a1 == a2:
        print("Yes")
else:
        print("No")

Submission status: Accepted

Solution code:
n=int(input())
A=input()
if(n%2==0):
    i=0
    j=n//2
    flag=True
    while(i<n//2):
        if(A[i]!=A[j]):
            # print("No")
            flag=False
            break
        i+=1
        j+=1
    if(flag):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
nn = n//2
ss = s[:nn]
sss = ss + ss
if sss == s:
	print ("Yes")
else:
	print ("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

mid = N//2

if S[0:mid] == S[mid:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
T = list(input())
A = T[:N//2]
B = T[N//2:]
if A == B:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
s = str(input())

x = N // 2

S=[]
for i in s:
    S.append(i)
    
if (S[:x] == S[x:]) and (N % 2 == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main(n: int, s: str):
    med = n // 2

    if s[:med] == s[med:]:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)

Submission status: Accepted

Solution code:
x=int(input())
a=input()
if x%2==1:
    print("No")
else:
    if a[:x//2]==a[x//2:]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
def solve(n, s):
    if n % 2 == 1:
        return "No"
    m = n // 2
    for i in range(m):
        if s[i] != s[m + i]:
            return "No"
    return "Yes"


def main():
    n = int(input())
    s = list(input())
    res = solve(n, s)
    print(res)


def test():
    assert solve(6, "abcabc") == "Yes"
    assert solve(6, "abcadc") == "No"
    assert solve(1, "z") == "No"


if __name__ == "__main__":
    test()
    main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()

res = "No"

if N % 2 == 0:
    mid = N // 2
    if S[:mid] == S[mid:]:
        res = "Yes"

print(res)

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if S[0:N//2] == S[N//2:N]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
s = str(stdin.readline().rstrip())

if n % 2 == 1:
    print("No")
else:
    e = n/2
    if s[0:int(e)] == s[int(e):n]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import sys

def _s(): return sys.stdin.readline().strip()
def _i(): return int(sys.stdin.readline().strip())

n = _i()
s = _s()

ans = "No"
if n%2==0:
    nh = n//2
    if s[:nh]==s[nh:]: ans = "Yes"
#
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()

if n % 2 != 0 :
    print('No')
else:
    half = n // 2
    if s[0:half] == s[half:n]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N%2==1:
    print('No')
else:
    N2 = N//2
    if S[:N2]==S[N2:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
def read():
    N = int(input().strip())
    S = str(input().strip())
    return N, S

def solve(N, S):
    if N % 2 == 0:
        half = N // 2
        return S[:half] == S[half:]
    return False

def yesno(flag):
    return "Yes" if flag else "No"

if __name__ == '__main__':
    inputs = read()
    output = solve(*inputs)
    output = yesno(output)
    print("%s" % output)

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n % 2 == 1:
    print("No")
    exit()

nhalf = int(n/2)
if s[:nhalf] == s[-1 * nhalf:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
S = input()

sum = 0
if N % 2 == 0:
  for i in range(int(N/2)):
    if S[i] != S[i+int(N/2)]:
      sum += 1
else:
  sum = 1

if sum == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a=int(input())
s=input()
if a % 2 != 0:
  print('No')
else:
  l=a//2
  if s[:l] == s[l:]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2 == 1:
  print("No")
elif S[:N//2]==S[N//2:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 == 1:
    print('No')
else:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n=int(input())
a=input()
x=n/2
if n%2!=0:
    print("No")
else:
    if a[:int(x)]==a[int(x):]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 == 0:
    t = s[:n//2]
    """
    for i in range(n//2):
        t.append(s[i])
        t.append(t)
    """
    t = t+t
    if s == t:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
a = 0
if N%2 == 1:
    print("No")
else:
    for i in range(N//2):
        if S[i] == S[i+(N//2)]:
            a += 1
    if a == N//2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n=int(input())
S=input()
if n %2 == 1:
    print('No')
    quit()
else:
    U=S[:n//2]
    T=S[n//2:]
    if U == T:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 ==1:
    print("No")
    exit()

nn = n//2

a = s[0:nn]
b = s[nn:]

if a == b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

flag = True
if N%2==1:
    flag = False
else:
    for i in range(N//2):
        if S[i]!=S[i+N//2]:
            flag = False

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2==1 or S[:N//2] != S[N//2:]:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = s[: n // 2]
b = s[n // 2: ]
if(a == b): print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
N=int(input())
S=input()
if N%2 == 0:
  if S[0:N//2] == S[N//2:N]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 == 1:
    print("No")
    exit()

if S[0: N // 2] == S[N // 2:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
S = input()
if(N%2 != 0):
  print('No')
else:
  s1 = S[:int(N/2)]
  s2 = S[int(N/2):]
  if(s1 == s2):
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 0:
  half = n//2
  ans = "No"
  for i in range(n-half+1):
    if 2*s[i:i+half] == s:
      ans = "Yes"
      break
else:
  ans = "No"
print(ans)

Submission status: Accepted

Solution code:
import subprocess
import os
import time


import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

# input = sys.stdin.readline


def main():
    n = int(input())
    s = input()

    if n % 2:
        print('No')
        sys.exit()

    if s[0: int(n/2)] == s[int(n/2):]:
        print('Yes')
        sys.exit()

    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 != 0:
    print("No")
else:
    if s[:(n//2)] == s[(n//2):]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())

s = input()

if n %2 ==1:
    print("No")

else:
    if s[0:int(n/2)] == s[int(n/2):n]:
        print("Yes")
        
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys

n = int(input())
s = input()

if (n%2!=0):
    print("No")
    sys.exit(0)

l = n//2
if s[:l] == s[l:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
sArray = input()

flag = True
if N % 2 == 0:
    n2 = N // 2
    for i in range(N//2):
        if sArray[i] != sArray[i+n2]:
            flag = False
            break
else:
    flag = False

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n % 2 != 0:
    print("No")
else:
    if s[: n // 2] == s[n // 2 :]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2 ==1:
    print("No")
    exit()
else:
    if S[:int(N/2)] == S[int(N/2):]:
        print('Yes')
    else:
        print("No")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    if N%2 == 1:
        print('No')
        exit()
    for i in range(N//2):
        if S[i] != S[N//2+i]:
            print('No')
            exit()
    print('Yes')

if __name__ == '__main__': main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()

h = n // 2

if s[:h] == s[h:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n%2 == 1:
    print("No")
else:
    if s[:n//2] == s[n//2:]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
input = sys.stdin.readline


def main():
    n = int(input())
    s = input()

    if n % 2 != 0:
        print('No')
        return

    for i in range(int(n/2)):
        if s[i] != s[i + int(n/2)]:
            print('No')
            return

    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    s = input()
    h = int(n /2)


    if (n % 2) ==  1:
        print('No')
    else:
        if s[0:h] == s[h:n]:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
b=0
if n%2 == 1:
  print("No")
else:
  for i in range(n//2):
    if s[i] != s[(n//2)+i]:
      b=1
  if b==0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n % 2 != 0:
    print('No')
    exit()

mid = n // 2

t1 = s[0:mid]
t2 = s[mid:]

print('Yes') if t1 == t2 else print('No')

Submission status: Accepted

Solution code:
import math
import sys
input = sys.stdin.readline


def main():
    sc = Scan()
    n = sc.intarr()[0]
    s = sc.strarr()[0]
    s1 = s[0:(n//2)]
    s2 = s[(n//2):]
    if s1 == s2:
        print('Yes')
    else:
        print('No')


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())

if n%2==0 and s[:n//2]==s[n//2:]:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n % 2 == 0:
    if s[:int(n/2)] == s[int(n/2):]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())
S=str(input())
x=''
y=''
for i in range(N//2):
  x+=S[i]
for i in range(N//2,N):
  y+=S[i]
if x==y:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=int(input())
S=input()

if N%2==1:
  print('No')
else:
  for i in range(N//2):
    if S[i]!=S[i+N//2]:
      print('No')
      break
    elif i==N//2-1:
      print('Yes')

Submission status: Accepted

Solution code:
n=int(input())
s=input()
n2=int(n/2)
n3=s[0:n2]

if n3*2 == s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

h = n // 2
print("Yes" if s[:h] == s[h:] else "No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 != 0:
    print("No")
else:
    if(s[:n//2] == s[n//2:]):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics


# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

def getInputStr():
    inputNum = str(input())
    return inputNum

n = getInputInt()

s = getInputStr()

tmplist = list(s)
listA = tmplist[0: int(len(s)/2)]
listB = tmplist[int(len(s)/2) : len(s)]

if listA == listB:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n %2 ==1:
  print('No')
  exit(0)
for i in range(int(n/2)):
  if s[i] != s[int(i+n/2)]:
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

Solution code:
N=int(input())
S=input()
if len(S)%2==1:
    print('No')
elif S[0:N//2]==S[N//2:len(S)]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 == 0:
    if S[:N//2] == S[N//2:]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
flag = 0
if len(S)%2 != 0:
    flag = 1
ans1 = ''
ans2 = ''
for i in range(N):
    if i < N//2:
        ans1+=S[i]
    else:
        ans2+=S[i]
if ans1==ans2 and flag==0:
    print('Yes')
if ans1 != ans2 or flag ==1:
    print('No')
# print(ans1,ans2,flag)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
half = int(n / 2)
if n % 2 != 0:
    print('No')
else:
    if s[:half] == s[half:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
if n % 2 == 1:
  print("No")
else:
  half_s1 = "".join(s[0:n//2])
  half_s2 = "".join(s[n//2:n])
  if half_s1 == half_s2:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
N_half = N//2
if S == S[:N_half]+S[:N_half]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]



    N = int(input())
    S = input()
    lenstr = len(S)
    if lenstr % 2 == 1:
        print('No')
        return
    else:
        if S[:lenstr//2] == S[lenstr//2:]:
            print('Yes')
        else:
            print('No')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    S = input()
    if N % 2 > 0:
        print("No")
    else:
        if S[:N//2] == S[N//2:]:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

ans = 'No'

if n%2 == 0:
  split_n = n//2
  if s[:split_n] == s[split_n:]:
    ans = 'Yes'
    
print(ans)

Submission status: Accepted

Solution code:
l = int(input())
s = input()
s1 = s[:l // 2]
s2 = s[l//2:]
if s1 == s2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())

if s[:n//2] == s[n//2:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = input()
c = 0
if n%2 == 0:
    for i in range(0,n//2):
        if l[i] == l[i + n//2]:
            continue
        else:
            print('No')
            c = 1
            break
else:
    c = 1
    print('No')
    
if c == 0:
    print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 != 0:
    print('No')
    
else:
    if S[:N//2] == S[-1*N//2:]:
        print('Yes')
        
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys
N = int(input())
S = input()
if N % 2 == 1:
    print("No")
    sys.exit()
n = N // 2
if S[:n] != S[n:]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

s1 = s[0:n//2]
s2 = s[n//2:n]

# print(s1)
# print(s2)

if s1 == s2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 != 0:
  print('No')
  quit()

middle = int(N / 2)
if S[:middle] == S[middle:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
if n%2==1:
    print("No")
    exit()
s=input()
for i in range(n//2):
    if s[i]!=s[n//2+i]:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
# input = sys.stdin.readline
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    N=ii()
    if N%2:
        print('No')
        exit()
    S=list(input())
    s1=S[:N//2]
    s2=S[N//2:]
    for i in range(N//2):
        if s1[i]!=s2[i]:
            print('No')
            exit()
    print('Yes')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())

if s[:n//2]==s[n//2:]:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	S = input()
	S = S[:-1]

	if N % 2 == 1:
		print("No")
		sys.exit()

	tmp = int(N / 2)
	if S[:tmp] == S[tmp:]:
		print("Yes")
	else:
		print("No")


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

import numpy as np

def main():
    n = int(input())
    s = input().rstrip()

    x = n//2



    if s[:x] == s[x:]:
        print("Yes")
    else:
        print("No")



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

N = int(input())
S = str(input())
#a, b = map(int, input().split())
#array = [int(s) for s in input().split()]

if N % 2 == 0 and S[0:int(N/2)] == S[int(N/2):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if s[:int(n/2)] == s[int(n/2):]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
s=input()

if len(s)%2==1:
  print("No")
else:
  if s[:n//2]==s[n//2:]:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 == 1:
    print('No')
else:
    if S[:N // 2] == S[N // 2:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n = int(input())
list1 = list(input())
s = n//2
if n%2 != 0:
    print("No")
else:
    a = list1[:s]
    b = list1[s:]
    if a == b:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l = len(s)
if n%2==0:
  if s[:int(n/2)] == s[int(n/2):]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if s[:(n//2)] == s[(n//2):]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if S[:int(N / 2)] == S[int(N / 2):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2 != 0:
    print("No")
    quit()
else:
    if S[:N//2] == S[N//2:]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()

flag = True

if (n%2 != 0):
    flag = False
else:
    s1 = s[:int(n/2)]
    s2 = s[int(n/2):]
    if (s1 != s2):
        flag = False

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
if n%2==1:
    print("No")
    exit()
t=s[:int(n/2)]
if t+t==s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = int(input())
N = input()
if len(N) % 2 == 0:
    for i in range(len(N) // 2):
        if not N[i] == N[len(N) // 2 + i]:
            break
    else:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
N = int( input() )
a = N // 2
e_list = list( input() )
if e_list[0:a] == e_list[a:N+1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 != 0:
    print('No')
else:
    n = int(N / 2)
    if S[:n] == S[n:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 0 :
    half = s[:n//2]
    if s == half*2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
S = list(str(input()))

if N % 2 == 1:
    print("No")
else:
    a = 0
    for i in range(int(N/2)):
        if S[i] == S[int(N/2) + i]:
            a += 1
    if a == int(N/2):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 != 0:
    print("No")
else:
    N_left = S[0:N//2]
    N_right = S[N//2:N]
    if N_right == N_left:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
S=list(input())

if N%2==1:
    print("No")
else:
    a="".join(S[:N//2])
    b="".join(S[::-1][:N//2][::-1])
    if a==b:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
l = int(input())
a = input()
if a[0:int(l/2)] == a[int(l/2):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 1:
    print("No")
    exit()
else:
    if s[0:int(n/2)] == s[int(n/2):]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
n = int(input())
s = list(input())


if n % 2 == 1:
    print('No')
    sys.exit()

else:
    lent = int(n / 2)
    if s[:lent] == s[lent:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()

def cond():
    if n % 2 == 1:
        return False
    else:
        return s[:n//2] == s[n//2:]

if cond():
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()

a = S[0 : int(N / 2)]
b = S[int(N / 2) :]
if a == b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
s = input()
if n % 2 == 0:
    if s[:n//2] == s[n//2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
T = S[0:N//2]
if S == T+T:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2 == 1:
  print('No')
elif S[:N // 2] == S[N // 2:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if n < 2:
  print('No')
else:
  left = s[0:n//2]
  right = s[n//2:]

  print('Yes' if left == right else 'No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
M = N//2


if N % 2 == 0 and S[:M] == S[M:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2 == 1:
    print('No')
else:
    if S[:N//2] == S[N//2:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()

if s[0:n//2] == s[n//2:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()

t = s[:len(s)//2]
if s == t+t:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
s=input()
if n%2==1:
    print("No")
else:
    if s[:n//2:]==s[n//2::]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()

if N % 2 == 0 and S[:N//2] == S[N//2:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
s=input()

ans=True

if n%2==1:
	ans=False
else:
	if s[0:n//2]!=s[n//2:]:
		ans = False

if ans is True:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if S[:N//2] == S[N//2:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = str(list(s)[:n//2])
b = str(list(s)[n//2:])
if(a == b):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# coding : utf-8

N = int(input())

if(N % 2 != 0):
    print("No")
else:
    S = input()

    if(S[:N//2] == S[N//2:]):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    s = list(input())

    temp1 = s[:n//2]
    temp2 = s[n//2:]
    if temp1 == temp2:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
s = ns()

if s[:(n//2)] ==s[(n//2):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools
# ひとつ入力
n = int(input())
# 文字列を一文字ずつのリストに代入 test は['t', 'e', 's', 't']
s = list(input())

if n % 2 ==1:
    print("No")
    exit()

for i in range(n//2):
    if s[i] != s[i+n//2]:
        print("No")
        exit()

print("Yes")