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

# 整数 > 整数型
def I(): return int(input())

# 整数列 '1 2 3 4' > 整数型リスト
def IsIl(): return list(map(lambda x: int(x), input().split()))

# 改行挟む整数列　'1/n 2/n 3/n' > 整数型りすと
def InIl(n): return [input() for i in range(n)]

# 整数列 '1 2' > 整数型タプル
def IsIt(): return map(lambda x: int(x), input().split())

# 改行挟む整数列　'1\n 2\n 3\n' > 整数型たぷる
def InIl(n): return map(input() for i in range(n))

# 文字列 'abcd' > 文字型リスト
def SsSl(): return list(map(lambda x: x, input()))

# 整数 '1234' > 整数型リスト

# 文字列 'aba' > 辞書（文字型:個数）{'a':2,'b':1}
def SSd():
    from collections import defaultdict
    A = input() # [int(i) for i in input().split()]
    dd=defaultdict(int)
    for a in A:
        dd[a]+=1
    return dd

#リストにn個要素を読み込む

# その他アルゴリズムテンプレート
# https://qiita.com/chun1182/items/ddf2b6cba932b2bb0d4e
n = int(input())

string = input()

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

Submission status: Accepted

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


flag=0

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


else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 文字列の入力
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f():
    n = int(input())
    s = input()
    if n%2:
        return "No"
    else:
        half = n//2
        for i in range(half):
            if s[i] != s[i+half]:
                return "No"
        return "Yes"

print(f())

Submission status: Accepted

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

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

elif s[:int(N/2)] == s[int(N/2):]:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# coding UTF-8
# 
# problem B
# 

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
list = [c  for c in s]

if len(list) % 2 == 0:
    l = int(len(list)/2)
else:
    l= int((len(list)+1)/2)

harf = list[:l]

if list == harf + harf:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

if __name__ == '__main__':
    abc_b()

Submission status: Accepted

Solution code:
def is_doubled_string(N, S):
    if N % 2 == 1:
        return False
    
    half = N // 2
    for i in range(half):
        if S[i] != S[i + half]:
            return False
    else:
        return True


N = int(input())
S = input()
res = is_doubled_string(N, S)
if res:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
num = int(input())
str = input()
ans = "No"

if num % 2 == 0:
	str_len_half = int(num / 2)
	if str[:str_len_half] == str[str_len_half:]:
		ans = "Yes"

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
S = input()
    
l = 0
r = int(N / 2)
f = False

if N % 2 == 1:
    f = True
    print("No")
        
while r < N and f == False:
    if S[l] != S[r]:
        print("No")
        f = True
        break
    l += 1
    r += 1
    
if f == False:
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
n = 0
A = []
B = []
if N % 2 == 0:
  n = int(N / 2)
  for i in range(0, n):
    A.append(S[i])
    B.append(S[n+i])

if A == B and N % 2 == 0:
    print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
char = list(input())
n_half = round(n/2)

if n%2!=0 :
    print("No")
else :
    word1 = ""
    word2 = ""
    for i in range(n_half) :
        word1 += char[i]
        word2 += char[n_half + i]
    
    if word1==word2 :
        print("Yes")
    else :
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
ans = "No"
left = ""
right = ""

if n > 1: # 文字数1では成り立たない
    if n % 2 == 0: # 奇数では成り立たない    
        m = int((n/2)); # 中心の数123, 456
        for i in range(m):
            left += s[i]
        for ii in range(m):
            right += s[ii+m]
        if left == right:
            ans = "Yes"
print(ans)

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= 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(input())
a=N//2
count=0
if N%2==1:
    print("No")
else:
    for i in range(a):
        if S[i]==S[i+a]:
            count+=1
            pass

        else:
            break
    if count==N//2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    S = input()
    if n & 1:
        return False
    return S[:n // 2] == S[n // 2:]
print(["No", "Yes"][solve()])

Submission status: Accepted

Solution code:
N=int(input())
S=input()
f='sf'
s='fs'
if N%2==0 and N!=0:
    f,s=S[:int(N/2)], S[int(N/2):]
if f==s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cnt=int(input())
word=input()
if cnt%2==1:
    print("No")
    
elif cnt/2>=1:
    list=[word[i: i+int(cnt/2)] for i in range(0,len(word),int(cnt/2))]
    if list[0]==list[1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
l = int(input())
words = input()

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

m = int(len(words) /2)
first = words[0:m]
last = words[m:]
if first == last:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os
n = int(input())
list = list(map(str,input()))
l = len(list)
if l%2==1:
    print("No")
else:
    for i in range(0,l//2):
        if list[i]!=list[i+l//2]:
            print("No")
            exit()
    print("Yes")

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
S = input()
b = "w"
c = "w"

if n % 2 == 1 :
    print("No")
else :
    a = n // 2
    for i in range(0, a):
         b += S[i]
    for j in range(a, n):
         c += S[j]
         
    if b == c:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

import math

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

l = int(N/2)

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

Submission status: Accepted

Solution code:
# your code goes herefro
from collections import Counter
n=int(input())
s=input()
res=Counter(s)
ans=[]
if(n==1):
	print("No")
else:
	m=n//2
	s1=""
	s2=""
	for i in range(0,m):
		s1+=s[i]
	for j in range(m,n):
		s2+=s[j]
	if(s1==s2):
		print("Yes")
	else:
		print("No")

Submission status: Accepted

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

n2 = int(n / 2)

sa = s[:n2]
sb = s[n2:]

if sa == sb:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

f = "";
b = "";

if n % 2 == 0 :
	for i in range(n):
		if i < n / 2 :
			f += s[i]
		else :
			b += s[i]
	if f == b :
		print("Yes")
	else :
		print("No")
else :
	print("No")

Submission status: Accepted

Solution code:
a = int(input())
b = input()
c = int(a / 2)

d = b[0:c]
e = b[c:]
if d == e:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

else:
    count=0
    for i in range(0,int(n/2)):
        if s[i]==s[i+int(n/2)]:
            count=count+1
    if count==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:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019 11/16
# ABC 145 B Echo


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

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

elif N % 2 == 0:
    mid = N // 2
    is_rep = True

    for i in range(mid):
        if(S[i] != S[mid+i]):
            is_rep = False
            break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
strlen = int(input())
if strlen % 2 == 1:
  print("No")
else:
  string = input()
  ans = "Yes"
  halfLen = strlen // 2
  for i in range(halfLen):
    if string[i] != string[i+halfLen]:
      ans = "No"
      break
  print(ans)

Submission status: Accepted

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

for i in range(n):
    a=''.join(s[:i+1])
    b=''.join(s[i+1:])
    if a==b:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

if l %2 == 1:
  print('No')
else:

  t = int(l / 2)


  if (s[0:t] == s[t:l+1]):
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

a = S[0:t]
b = S[t:N]
if a == b:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = str(input())
if a%2==1:
  print("No")
else:
  c = b[:a//2]
  d = c+c
  if b==d:
    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:
    print('No')
    exit()
if S[:N//2] == S[N//2:]:
    print('Yes')
    exit()
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:
def main():
    length = int(input())
    input_str = str(input())
    
    if length % 2 == 1:
        print('No')
        return
    
    border = int(length / 2)
    first_half = input_str[:border]
    latter_half = input_str[border:]

    if first_half == latter_half:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

s_list = list(s)
counter = "No"
a_list = []
b_list = []
if n % 2 == 0:
    for i in range(n//2):
        a_list.append(s_list[i])
        b_list.append(s_list[i + n//2])
    if a_list == b_list:
        counter = "Yes"
print(counter)

Submission status: Accepted

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

flag = 1

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

Submission status: Accepted

Solution code:
from sys import stdin
#from collections import deque
#from math import sqrt, floor, ceil, log, log2, log10, pi, gcd
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return [x for x in mi()]
def si(): return stdin.readline()
z=['Yes', 'No']
n=ii()
f=n%2
a=si()
if not f:
    x=n//2
    for i in range(x):
        if a[i]!=a[i+x]:
            f=1
            break
print(z[f])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


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


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


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    r = II()

    print(r*r)
    return

# B


def B():
    N = II()
    S = input()
    if len(S) % 2 == 0:
        print('No')
        return
    j=S[N//2]
    p=N//2
    for i in S[:N//2]:
        if i != j:
            print('No')
            return
        p+=1
        j=S[p]

    print('Yes')

    return

# C


def C():
    N = II()
    A = LI()
    B = LI()

    L = []
    count = 0
    for i in range(2, int(sqrt(N)+2)):
        if N % i == 0:
            L.append(N/i)
            count = 1
    if count == 0:
        print(N-1)
    else:
        print(int(L[-1]-2+(N/L[-1])))

    return

# D


def D():

    a, b, x = LI()
    BIG = a*a*b/2
    if x > BIG:
        y = 2*b-(2*x/a/a)
        print(math.degrees(math.atan(y/a)))
    else:
        y = 2*x/a/b
        print(math.degrees(math.atan(b/y)))
    return

# E


def E():
    N, K = LI()
    A = LI()
    F = LI()
    A.sort(reverse=True)
    F.sort()
    cost = []
    for i in range(len(N)):
        cost.append(A[i]*F[i])

    a = F[cost.index(max(cost))]

    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
def judge(N, S):
    length = len(S)
    if N % 2 == 0 and S[:length//2] == S[length//2:]:
        return 'Yes'

    return 'No'


N = int(input())
S = input()
print(judge(N, S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
s = str(input())
if (n % 2 != 0):
    print('No')
    sys.exit()
h = int(n / 2)
if (s[:h] == s[h:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    half_length = n // 2

    if s[:half_length] == s[half_length:]:
        return 'Yes'

    return ' No'


print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

s1 = s[:(n//2)]
s2 = s[(n//2):]

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

Submission status: Accepted

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

if n%2 == 1:
    print('No')
else:
    ans = 'Yes'
    s1 = s[0:int(n/2)]
    s2 = s[int(n/2):n]
    for i in range(int(n/2)):
        if s1[i] != s2[i]:
            ans  = 'No'
    print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2 != 0:
    print("No")
    exit()

s = N//2

check = S[s:].replace(S[:s],"")
if check:
    print("No")
else :
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N > 1:
  if S[0: N // 2] == S[N // 2 :]:
    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:
    correct = 0
    
    for i in range(N//2):
        if S[i] == S[i + N//2]:
            correct += 1
            
    if correct == N//2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#入力
N = int(input())
S = input()

#文字列の前半部分を取得して二つ繋げる
halfN = int(N/2)
seq = ""

for i in range(2):
    for j in range(halfN):
        seq = seq + S[j]
        
#判定
if seq == S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

t = int(n/2)

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

Submission status: Accepted

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

d, a = divmod(N, 2)
if a == 0 and S[:d] == S[d:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    _, s = args
    m = len(s)//2
    return 'Yes' if s[:m] == s[m:] else 'No'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
ans = "No"
first = ""
latter = ""
if N % 2== 0:
    for i in range(0,N//2):
        first += S[i]
    for j in range(N//2,N):
        latter += S[j]
    if first == latter:
        ans = "Yes"
        
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

s = input()

s_list = list(s)
flag = True
if n % 2 == 1:
    print('No')
    flag = False

if flag:
    if "".join(s_list[:int(n/2)]) == "".join(s_list[int(n/2):]):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(str(input()))
if n % 2 ==0:
    ans=0
    for i in range(n//2):
        if s[i]==s[n//2+i]:
            ans+=1
        else:
            ans+=0

    if ans==n//2:
        print('Yes')
    else:
        print('No')   

else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
i = int(input())
s = str(input())
i2=int(i/2)

if i%2 != 0:
    print("No")
elif s[0:i2]==s[i2:i2*2]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

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

# N = 6
# S = 'abcabc'

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

l = list(S)

# front = l[0:int(len(l) /2)]
# print(front)
# rear = l[int(len(l) / 2) : ]
# print(rear)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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()

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

Submission status: Accepted

Solution code:
import sys
N=int(input())
S=str(input())
tmp=[]
s=list(S)
tmpl=N


if N==1 or N%2!=0:
    print('No')
    sys.exit()
else:
    for i in range(int(N/2)):
        tmp.append(s[i])
tmp2=''
tmp2=''.join(tmp)
if tmp2+tmp2==S:
    print('Yes')
elif N!=0 or N&2==0:
    print('No')

Submission status: Accepted

Solution code:
a = int(input())
b = input()
c = list(b)
if a % 2 != 0:
  d = "No"
else:
  e = c[:a//2]
  f = c[a//2:]
  if e == f:
    d = "Yes"
  else:
    d = "No"
print(d)

Submission status: Accepted

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

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

    n1 = S[: N // 2]
    n2 = S[N // 2 :]

    if n1 == n2:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a=int(input())
b=input()

# 半分
half = int(a/2)

sento = b[0:half]
kouho = b[half:]

if(sento == kouho):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
lines = stdin.readlines()

N = int(lines[0])
S = lines[1]

if N%2 == 0 :
  N2 = int(N / 2)
  N3 = int(N / 2 + 1)
  T1 = S[0:N2]
  T2 = S[N2:N]
  if T1 == T2 :
    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 = input()
k = int(n/2)
# =============================================================================
if n % 2 == 1:
    print("No")
else:
    if s[:k] == s[k:]:
        print("Yes")
        
    else:
        print("No")

Submission status: Accepted

Solution code:
import numpy as np
input1 = list(map(int,input().split()))
input2 = input()

N = input1[0]
S = input2

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
text=str(input())
half=int(n/2)
text1 = text[0:half]
text2 = text[half:n]
if text1 == text2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, S = int(input()), input()
print("NYoe s"[S[N//2:]==S[:N//2]::2])

Submission status: Accepted

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