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:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, S: str):
    print(YES if S[:N//2] == S[N//2:] else NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import bisect

mod = 1000000007

def main():
    n = int(input())
    s = input()
    if n%2!=0:
        print("No")
        return
    for i in range(n//2):
        if s[i]!=s[i+n//2]:
            print("No")
            return
    print("Yes")
    return


if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
S = input().rstrip()


if N%2 != 0:
    res = "No"
else:
    if S[:N//2] == S[N//2:]:
        res = "Yes"
    else:
        res = "No"

print(res)

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 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 len(S)%2 != 0:
    print("No")
    exit()
if S[:len(S)//2] == S[len(S)//2:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#import heapq
import itertools
#import math
#import numpy as np
import sys

N = int(input())
S = input()
#D = list(map(int, input().split()))
#S = [input() for _ in range(H)]
#T = [list(map(int,input().split())) for _ in range(N)]
#sys.exit()
a = S[0:int(N/2)]
b = S[int(N/2):N]
if a == b :
    print('Yes')
else :
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#N=int(input())
#A=list(map(int,input().split()))
N=int(input())
S=input()
if(S[:N//2]==S[N//2:]):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
x = int(input().strip())
s = input().strip()

if x % 2 == 1:
    print("No")
    exit()
if s[0:x//2] == s[x//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())
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
    else:
        print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

S = input()

cut = int(N/2)

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    s = S()
    if n % 2 == 1:
        print("No")
        return
    if s[:n//2] == s[n//2:]:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

def solve():
    N = int(input())
    S = input()
    l = len(S)//2
    if S[:l] == S[l:]:
        return 'Yes'
    else:
        return 'No'

    return 

if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

s = list(input())

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


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

Submission status: Accepted

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

front = S[:N//2]
back = S[N//2:]

if front == back:
    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[N//2+i]:
            print('No')
            break
    else:
        print('Yes')

Submission status: Accepted

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

a = ''
b = ''
if(N%2 == 1):
  print('No')
else:
 for i in range(N):
   if(i < N//2): a += S[i]
   else: b += S[i]
 if(a == b):
  print('Yes')
 else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
a = input()
good = True
if n%2 == 1:
    good = False
if a[:n//2] != a[(n//2):]:
    good = False
if good:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

s_len = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2 != 0:
    print("No")
else:
    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 == 1:
    print("No")
else:
    T = S[:(N//2)]
    if T+T == S:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
nt=n//2
if(s[:nt] ==s[nt:]):
    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()
f = False

if n % 2 == 0:
	l = s[0:n//2]
	f = (l + l == s)

print("Yes" if f else "No")

Submission status: Accepted

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

ss = s[: n // 2]

if ss + ss == s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if N % 2 == 1:
    print("No")
else:
    half = N // 2
    head = S[:half]
    tail = S[half:]
    if head == tail:
        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())
L = input()
if L[0:n//2] == L[n//2:n]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N = int(input())
    S = input().rstrip()
    h = N // 2
    a = S[:h]
    b = S[h:]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)


def main():
  n = ni()
  s = ns()
  mid = n // 2
#   print(s[0:mid], s[mid:n])
  if s[0:mid] == s[mid:n]:
    print("Yes")
  else:
    print("No")

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2: print("No"); exit()
s1 = s[:n//2]
s2 = s[n//2:]
print("Yes" if s1 == s2 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:
N= int(input())
S = input()
L = len(S)
if L % 2 == 1:
    print("No")
else:
    if S[0:L//2] == S[L//2:L]:
        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")
		exit(0)
print("No")

Submission status: Accepted

Solution code:
n = input()
s = input()
n = len(s)//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 and S[:N//2]==S[N//2:]:
    print('Yes')
else:
    print('No')

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==1:
    print("No")
else:
    ans=True
    for i in range(n//2):
        if s[i]!=s[i+n//2]:
            ans=False
    if ans:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

print("Yes")

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()
ans="No"
if n%2==0:
  if s[:n//2]==s[n//2:]:
    ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2:
    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()

cnt = 0

if n % 2 == 1:
    cnt = 1
else:
    k = int(n/2)
    for i in range(k):
        if s[i] != s[k+i]:
            cnt = 1

if cnt == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2 == 1:
    print('No')
else:
    if S[0: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())
s = input()

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

if n == 1:
    print('No')
    exit()

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

Submission status: Accepted

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

if len(s)%2 != 0 :
  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

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()
S = input()

if N % 2 == 0:
    a = S[:N//2]
    b = S[N//2:]
    if a == b:
        Yes()
        exit()
No()

Submission status: Accepted

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

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

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

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:
    s = S[0:N//2]
    if S == s *2:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

L1 = []
L2 = []
ans = "No"
if N%2 == 0:
    for i in range(N//2):
        L1.append(S[i])
    for i in range(N//2, N):
        L2.append(S[i])
    if L1 == L2:
        ans = "Yes"
        
print(ans)

Submission status: Accepted

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

S1 = S[:N//2]
S2 = S[N//2:]

if N==1:
  print('No')
elif S1==S2:
  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 = list(input())

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

Submission status: Accepted

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


def main():
    N = int(input())
    S = input().strip()

    if N % 2 != 0:
        print("No")
        exit()
    for i in range(N // 2):
        if S[i] != S[i + N // 2]:
            print("No")
            exit()

    print("Yes")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

nn = N//2

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if len(S)%2 == 0:
    if S[:len(S)//2] == S[len(S)//2:]:
        print("Yes")
    else:
        print("No")
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 = str(input())

if n%2 == 1:
  print('No')
  exit()
else:
  s_ = s[0:n//2]
  #print(s_)
  if s_+s_ == s:
    print('Yes')
  else:
    print('No')

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:
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 n%2 != 0:
  print('No')
else:
  if s[0:n//2] == s[n//2:n]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
s=input().rstrip()
if n%2==0:
    m=n//2
    a=s[0:m]
    b=s[m:n]
    if a==b:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re
import heapq


from copy import deepcopy
import itertools

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))






def main():
    n = ii()
    s = input()
    n2 = n//2

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




main()

Submission status: Accepted

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

if n%2==0:
    ls_a=ls[:n//2]
    ls_b=ls[n//2:]
    if "".join(ls_a)=="".join(ls_b):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7




def main():
    # r = int(input())
    # print(r*r)
    n = int(input())
    s = 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")
        




            
            
            
            
            
        


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n & 1:
  print("No")
else:
  can = True
  for i in range(n >> 1):
    if s[i] != s[i + (n >> 1)]:
      can = False
  if can:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
first = S[:N//2]
last = S[N//2:]

if first==last:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N%2==1:
  print('No')
  exit()

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 == 1:
    print('No')
else:
    if S[:(N//2)] == S[(N//2):]:
        print('Yes')
    else:
        print('No')
# print(S[:(N//2)])
# print(S[(N//2):])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
nn=n//2
if n%2==0 and s[:nn]*2==s:
  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
t=s[0:n]
for i in range(n):
    if t[i]==s[n+i]:
        continue
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    n = int(input().strip())
    v = input().strip()
    if n % 2 == 1:
        print('No')
        return
    if v[:n//2] == v[n//2:]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

if r == 1:
    print('No')
    exit()

a = s[:r//2]
b = s[r//2:]

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()
if N%2==0 and S[:int(N/2)]==S[int(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:n]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def solve():
  N = readInts()[0]
  S = input()
  if N % 2 == 1:
    return 'No'

  for i in range(N // 2):
    if S[i] != S[i + ( N // 2 )]:
      return 'No'

  return 'Yes'

def main():
  print(solve())

if __name__ == "__main__":
  main()

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()
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:
  result = 'No'
else:
  l = N//2
  if S[:l] == S[l:]:
    result = 'Yes'
  else:
    result = 'No'

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
input=lambda :sys.stdin.readline().rstrip()
inputs= sys.stdin.buffer.readlines
INF=float("inf")
MOD=10**9+7
#input = sys.stdin.buffer.readline
#sys.setrecursionlimit(2147483647)
#rstrip().decode('utf-8')
#import math
#import numpy as np
#import operator
#import bisect
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#map(int,input().split())


def main():
	n=int(input())
	s=input()
	ans="Yes"
	if n%2==1 or s[:n//2]!=s[n//2:]:
		ans="No"
	print(ans)



if __name__ == '__main__':
	main()

Submission status: Accepted

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

if n%2==0:
    if s[:n//2]==s[n//2:]:
        print("Yes")
        exit()
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 = list(map(str, input()))
flg = 1
if N % 2 != 0:
	print("No")
else:
	for i in range(N // 2):
		if S[i] != S[N // 2 + i]:
			flg = 0
			break
	if flg:
		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:
import sys
input = sys.stdin.readline

N = int(input())
S = input()

if N % 2 != 0:
    print('No')
else:
    for i in range(N // 2):
        if S[i] == S[i + N // 2]:
            continue
        else:
            print('No')
            exit()
    print('Yes')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
s = input()
print(['No', 'Yes'][s[:n // 2] == s[n // 2:]])

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()
x = s[0:n//2] 
if x + x == s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examB():
    N = I()
    St = S()
    if N%2==1:
        ans = "No"
    elif St[:(N//2)]==St[(N//2):]:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)



import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

Solution code:
n = int(input())
n = n//2
s = list(input())
if s[:n] == s[n:]:
    print("Yes")
    exit()
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')
            exit(0)
    print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
S = 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")

Submission status: Accepted

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