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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, S):
    if N % 2 != 0:
        return 'No'
    if S[:N//2] == S[N//2:]:
        return 'Yes'
    return 'No'


def main():
    N = read_int()
    S = read_str()
    print(slv(N, S))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

r = N % 2

if r == 1:
    print('No')
else:
    q = N // 2
    if S[:q] == S[q:]:
        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=list(input())
flag=False
if n%2==0:
  v=int(n/2)
  l=s[0:v];r=s[v:n]
  if l==r:
    flag=True
if flag:
  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()

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

Submission status: Accepted

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

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

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:
# -*- coding: utf-8 -*-
n = int(input())
s = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
if N % 2 == 1:
  print('No')
  exit()
else:
  T = S[0:N//2]
  Q = S[N//2:N]
if T == Q:
  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()
for i in range(n//2):
    if s[i]!=s[i+n//2]:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
s=list(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 = input()

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
t=""
def ans():
    for i in range(n//2+1):
       t=s[0:i+1]
       if(s==t+t):
           print("Yes")
           return
    print("No")
    return
ans()

Submission status: Accepted

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

Submission status: Accepted

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

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

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 != 0:
    print("No")
    exit()

half_n = N//2

for i in range(half_n):
    if S[i] != S[i+half_n]:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

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

pre = s[:n//2]
post = s[n//2:]

if pre == post:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)


def main():
    N = int(input())
    S = input()
    if N % 2 == 1:
        print("No")
        sys.exit()
    else:
        T1 = S[:N//2]
        T2 = S[N//2:]
        if T1 == T2:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
# X1_list = [int(input()) for i in range(N)]
# X2_list = [list(map(int,input().split())) for i in range(N)]
if N % 2 != 0:
    print('No')
else:
    mae = S[:N//2]
    ato = S[N//2:]
    #print(mae,ato)
    if mae == ato:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

T1 = S[0:N//2]
T2 = S[N//2:]

if T1 == T2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
len_s = len(s)
if len_s % 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=input()
s=input()

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

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

print("Yes")

Submission status: Accepted

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

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

n=N//2
a = S[0:n]
b = S[n:N]

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
mid = n // 2
t = s[:mid]
if t + t == s:
    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[:N//2] == S[N//2:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


class AtCoder:
    def main(self):
        N = int(input())
        S = input().rstrip()

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


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

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

    if N % 2 != 0:
        print('No')
        exit()
    s_1 = S[:len(S)//2]
    s_2 = S[len(S)//2:]
    if s_1 == s_2:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    N = int(input())
    S = input()
    if N%2!=0:
        print('No')
        return
    
    hanbun = N/2
    zenhan = ''
    kouhan = ''
    for i in range(N):
        if i >= hanbun:
            kouhan += S[i]
        else:
            zenhan += S[i]
    
    if zenhan == kouhan:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = "Yes"
for i in range(N//2):
    if S[i] != S[i+N//2]:
        ans = "No"
        break
if (N//2)*2!=N:
    ans = "No"
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
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:
  print("No")
  exit()

ba=(n/2)-1

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

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()
output = "No"
if N % 2 == 0:
    temp = S[:int(N/2)] + S[:int(N/2)]
    if temp == S:
        output = "Yes"
print(output)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
S = list(input())
f = True
if not N&1:
    n = N//2
    for i in range(n):
        if S[i]!=S[i+n]:
            f = False
else:
    print('No')
    exit()
if f:
    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:
n = int(input())
s = input()
if n % 2 != 0:
    print("No")
else:
    half = int(n // 2)
    if s[:half] == s[half:]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
s = input()

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

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = (stdin.readline().rstrip())
if S[0: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:
    flag = False
else:
    if s[:n//2] != s[n//2:]:
        flag = False

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

c = N/2

if N%2 != 0:
    print("No")
elif S[:int(c)] == S[int(c):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
if n%2 != 0:
  print("No")
  exit()
else:
  s = str(input())
  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()

ans = 'No'
if N % 2 == 0:
  if S[:N//2] == S[N//2:]:
    ans = 'Yes'

print(ans)

Submission status: Accepted

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

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

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 'Yes'

if N % 2 == 1:
  ans = 'No'
else:
  for i in range(int(N/2)):
    if S[i] != S[i+int(N/2)]:
      ans = 'No'
      
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import os

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

if n % 2 == 1:
    print("No")
    os.sys.exit()
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')
    exit()
else:
    for i in range(n//2):
        if s[i] != s[i+n//2]:
            print('No')
            exit()

print('Yes')

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
s = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
ans = "Yes"
if n % 2 == 0:
    for i in range(n//2):
        if s[i+n//2] != s[i]:
            ans = "No"
            break
    print(ans)
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:
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()
# print(S[:N//2], S[N//2:])
if N % 2 == 0:
  print('Yes' if S[:N//2] == S[N//2:] else 'No')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

N = int(input())
S = input().strip()

if N%2==1:
	ans = 'No'
else:
	former = S[0:N//2]
	latter = S[N//2::]
	if former==latter:
		ans = 'Yes'
	else:
		ans = 'No'


print(ans)

Submission status: Accepted

Solution code:
#import sys

#input = sys.stdin.readline
import math
#import bisect

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True


def main():
#    h,w,a,b = map(int, input().split())
    n = int(input())
    s = input()
    a = s[0:n//2]
    b = s[n//2:]
    if a==b:
        print("Yes")
    else:
        print("No")





if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
S=list(map(str,input()))
U=S[0:(N//2)]
if S==U+U:
  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:
# -*- 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:
n = int(input())
s = input()

if n % 2 == 1:
    print('No')
else:
    tmp = s[:n // 2]
    #print(tmp+tmp)
    if s == (tmp + tmp):
        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()
S_1 = S[:N//2]
S_2 = S[N//2:]
if S_1 == S_2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():  
    n = int(input())
    s = input()
    if n%2 == 0:
        x = n//2
        s1 = s[:x]
        s2 = s[x:]
        if s1 == s2:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    if N % 2 != 0:
        print('No')
    else:
        A = S[:N//2]
        B = S[N//2:N]
        if A == B:
            print('Yes')
        else:
            print('No')

  

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    S = str(input().strip())

    if N % 2 == 1:
        return 'No'
    
    if S[:N//2] == S[N//2:]:
        return 'Yes'

    return 'No'

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- Coding: utf-8 -*-

import sys




def main():
    N=int(input())
    S=input()
    if len(S)%2==1:
        print("No")
        exit(0)
    if S[:N//2] == S[N//2:]:
        print("Yes")
    else:
        print("No")



if __name__ == '__main__':
    main()

Submission status: Accepted

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

sf = s[:n]
sb = s[n:]

if sf == sb:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

N = int(input().split()[0])
S = input()

if N % 2 == 0:
    if S == S[: N // 2] + S[: N // 2]:
        ans = "Yes"
    else:
        ans = "No"
else:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

st = list(input())

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

Submission status: Accepted

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

if n % 2 == 1:
    print("No")
else:
    for i in range(int(n/2)):
        if s[i] != s[i + int(n/2)]:
            print("No")
            sys.exit()

    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
res = ""
ok = False
for i in range(len(s)):
  res = res+s[i]
  if res+res==s:
    ok = True
    break
if ok==True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 1:
    print('No')
else:
    n_half = int(n / 2)
    if s[:n_half] == s[n_half:]:
        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:
def 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")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

i = n // 2

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
if n%2 == 0:
    n_2 = n//2
    flag = 0
    for i in range(n_2):
        if s[i] != s[i + n_2]:
            flag = 1
    if flag:
        print("No")
    else:
        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())
if n%2==1:
  print('No')
else:
  s=input()
  l=s[:n//2]
  r=s[n//2:]
  if l==r:
    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:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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

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


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

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):n]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# 2019-11-16 21:01:15(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    n = int(sys.stdin.readline().rstrip())
    s = sys.stdin.readline().rstrip()
    if n % 2 == 1:
        ans = 'No'
    else:
        if s[:n//2] * 2 == s:
            ans = 'Yes'
        else:
            ans = 'No'
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())

S = input()

if N %2 == 1:
    print("No")
    sys.exit()
else:
    halfN = int(N/2)
    str1 = S[:halfN]
    str2 = S[halfN:]
    if str1 == str2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
from sys import exit

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:
# -*- coding: utf-8 -*-

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

# solve
ans = False
if S[0:int(N/2)] == S[int(N/2):]:
    ans = True

# output
print('Yes' if ans else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2 == 1:
    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:
# 2019/11/16

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

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

Submission status: Accepted

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