Problem:


Score : 200 points

Problem Statement

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

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

Constraints

1 \leq N \leq 100

S consists of lowercase English letters.

|S| = N

Input

Input is given from Standard Input in the following format:

N
S

Output

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

Sample Input 1

6
abcabc

Sample Output 1

Yes

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

Sample Input 2

6
abcadc

Sample Output 2

No

Sample Input 3

1
z

Sample Output 3

No



Sample input:
6
abcabc


Sample output:
Yes

Submission status: Accepted

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

first = s[:int(n / 2)]
last = s[int(n / 2):]

if n % 2 != 0:
    print('No')
elif first != last:
    print('No')
else:
    print('Yes')

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

        else:
            print('No')

ABC145B()

Submission status: Accepted

Solution code:
N = int(input())
S = input()
n = N//2
if S[:n]==S[n:]:
    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:
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys
#from fractions import gcd
setrecursionlimit(10**6)
input=stdin.readline

n=int(input().rstrip())//2
s=input().rstrip()
#print(s[:n],s[n:],"abc"=="abc")
print("Yes" if s[:n]==s[n:] else "No")

Submission status: Accepted

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

# 長さが奇数ならFalse
if len(S)%2 != 0:
    print("No")
    exit()

#print(S[0:int(len(S)/2)], S[int(len(S)/2):len(S)])
if S[0:int(len(S)/2)] == S[int(len(S)/2):len(S)]: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
'''input
6
abcabc
'''
# A coding delight
from sys import stdin, stdout
import gc
gc.disable()
input = stdin.readline

# main starts
n = int(input().strip())
string = input().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

res = False
if N % 2 == 0:
    T = S[:(N//2)]
    if T+T == S:
        res = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
t = int(n/2)

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

Submission status: Accepted

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

s_1half = s[:t]
s_2half = s[t:]

if n % 2 == 1:
    print("No")
elif s_1half == s_2half:
    print("Yes")
elif s_1half != s_2half:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
 
N = int(input())
S = list(str(input()))
 
if(N%2==1 or N==0):
    print("No")
    sys.exit()
 
if(N==2 and S[0]!=S[1]):
    print("No")
    sys.exit()
 
for x in range(0, N//2-1):
    if(S[x]!=S[N//2+x]):
        print("No")
        sys.exit()
 
print("Yes")

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    t = S()
    if N % 2 > 0:
        print('No')
        return
    if t[:N//2] == t[N//2:]:
        print('Yes')
    else:
        print('No')

main()

Submission status: Accepted

Solution code:
n, s = open(0).read().split()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

S = str(input())

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

Submission status: Accepted

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

    if 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')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
  n = int(input())
  s = input()
  half, odd = divmod(n, 2)
  
  if odd:
    return 'No'
  
  if s[:half] == s[half:]:
    return 'Yes'
  
  return 'No'

print(solve())

Submission status: Accepted

Solution code:
n = [str(input()) for _ in range(2)]

if int(n[0]) == 1 or int(n[0]) % 2 == 1:
	print("No")
	exit()

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

Submission status: Accepted

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

res = S[:(N//2)] == S[(N//2):]

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

Submission status: Accepted

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

Submission status: Accepted

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

is_yes = False

if N % 2 == 0:
    if S[:N//2] == S[N//2:]:
        is_yes = True

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = int(input())
b = input()
c = int(len(b)/2)
d = b[:c]

if b == d+d:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

if T==S:
  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 = int(input())
S = input()
if N % 2 != 0:
    print('No')
else:
    for i in range(len(S)//2):
        if S[i] != S[i+len(S)//2]:
            print("No")
            break
        if i == len(S)//2 - 1:
            print("Yes")

Submission status: Accepted

Solution code:
N = input()
S = input()
index = len(S) // 2

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
len_S = len(S)
count = 0

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

else:
    for i in range(len_S//2):
        if S[i] == S[i+(len_S//2)]:
            count += 1
        else:
            print('No')
            break

    if count == len_S//2:
        print('Yes')

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

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

Submission status: Accepted

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

n = int(N/2)
S1 = S[:n]
S2 = S[n:]

if N % 2 == 1:
    print("No")
else:
    if S1 == S2 :
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
input()
l = input()
print("NYoe s"[l[0:int(len(l)/2)] == l[int(len(l)/2):len(l)]::2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
S = read().decode('utf8').rstrip()

# print(type(S))
# print(N//2)
# print(S)
# print(''.join(S[:N // 2]+S[:N//2]) )

flag = False
if N % 2 == 0:
    M = N // 2
    flag = S[:M] == S[M:]

ans = 'Yes' if flag else 'No'
print(ans)

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
S = read().decode('utf8').rstrip()
# print(type(S))
# print(N//2)
# print(S)
# print(''.join(S[:N // 2]+S[:N//2]) )

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

Submission status: Accepted

Solution code:
input = [input() for i in range(2)]
n = int(input[0])
s = input[1]

if(n % 2 != 0):
  print('No')
elif(n != len(list(s))):  
  print('No')
else:  
  s_list = list(s)
  num = n/2
  s1 = s_list[:int(num)]
  s2 = s_list[int(num):]

  if(len(s1) != len(s2)):
    print('No')    
  else:  
    flag = True  
    for index in range(len(s1)):
      if(s1[index] != s2[index]):
        flag = False

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

Submission status: Accepted

Solution code:
import sys


def solve(inp):
    N = int(inp.readline().strip())
    S = inp.readline().strip()

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


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    if n % 2 == 0:
        if s[:n // 2] == s[n//2:]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

l = int(len(s)/2)
a = ""
b = ""

for i in range(l):
  a += s[i]
  b += s[i+l]
  
if a==b:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 == 1:
    print('No')
else:
    t1 = s[0:n//2]
    t2 = s[n//2:n]
    if t1 == t2:
        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:
def solve():
    n = int(input())
    data = input()
    # n, data = [x for x in input().split(" ")]
    n = int(n)
    if data[:n//2] == data[n//2:]:
        return "Yes"
    return "No"

if __name__ == "__main__":
    # test = int(input())
    # for _ in test:
    print(solve())

Submission status: Accepted

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

if (N % 2 == 0):
    c = int(N / 2)

    n = 0
    for x in range(c):
        if S[x] == S[x + c]:
            n += 1 

    if n == c:
        print('Yes')  
    else: 
        print('No')
        
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

if int(a/2) != a/2:
    print('No')
else:
    c = b[0 : int(a/2)]
    #print(c)
    d = b[int(a/2) : a]
    #print(d)
    if c == d:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

if N%2==1:
    print("No")
else:
    m=int(N/2)
    s1=s[:m]
    s2=s[m:]
    if  s1==s2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

if(N%2 == 0):
  #Pythonでは、//で整数の商、%で余り（剰余、mod）が算出
  n = N//2
  #[:n] 0~n-1 [n:] n~最後まで
  if(S[:n] == S[n:]):
    print("Yes")
  else:
    print("No")
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:
n = int(input())
s = input()
if n%2==1:
  print('No')
else:
  if s[:n//2]==s[n//2:]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
d=1
for i in range(N//2):
  if S[i]!=S[i+N//2]:
    d=0
print('Yes' if d==1 and N!=1 and (N%2)==0 else 'No')

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
t = list(read())
if n % 2 == 1:
    print("No")
else:
    t1 = ""
    t2 = ""
    for i in range(n // 2):
        t1 += t[i]
        t2 += t[i + n // 2]
    if t1 == t2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
h = N//2
T = S[0:h:]
if(S == T + T):
	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:
# Echo

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

# solve
if N % 2 != 0:
    res = 'No'
else:
    if S[:len(S)//2] == S[len(S)//2:]:
        res = 'Yes'
    else:
        res = 'No'

# output
print(res)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
bbn=1000000007
	
#+++++

def is_ok(n,s):
	if n % 2 ==1:
		return False
	for ti,tj in zip(s[:(n//2)],s[(n//2):]):
		#pa((ti,tj))
		if ti != tj:
			return False
	return True
	
def main():
	n = int(input())
	s = input()
	ret = 'Yes' if is_ok(n,s) else 'No'
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

for i in range(N // 2):
    s = S[i]
    if s != 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')
 exit()

if 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 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:
n1 = int(input())

s2 = input()

r4 = "Yes"
if n1 % 2 == 1:
    r4 = "No"
for i3 in range(n1 // 2):
    if s2[i3] != s2[i3 + (n1 // 2)]:
        r4 = "No"

print(r4)

Submission status: Accepted

Solution code:
_ = input()
text = input()

if text[:len(text) // 2] == text[len(text) // 2:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = "No"

center = N//2

a1 = "".join(S[:center])
a2 = "".join(S[center:])

if a1 == a2:
    ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n%2!=0:
    print("No")
else:
    wk = len(s)//2
    for i in range(wk):
        if s[i]!=s[i+wk]:
            print("No")
            break
    else:
        print("Yes")

Submission status: Accepted

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

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

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

Submission status: Accepted

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


if N % 2 == 0:
    S1 = S[:int(N / 2)]
    S2 = S[int(N / 2):]

    if S1 == S2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

ans = 0
n = inp()
s = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
import math
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
S = input().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def ints():
  return [int(x) for x in input().split()]
def readi():
  return int(input())

n = readi()
s = input()

def no():
  print('No')
  exit()

if n%2>0:
  no()

for i in range(0, n//2):
  if s[i]!=s[i+n//2]:
    no()

print('Yes')

Submission status: Accepted

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

med = n // 2

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
	# n,m = map(int,input().split())
	n = int(input())
	s = str(input())
	# a = list(map(int,input().split()))
	# l = [list(map(int, input().split())) for _ in range(n)]
	# print(s+s)
	if s[:(int(n/2))] + s[:int(n/2)] == s:
		print("Yes")

	else:
		print("No")


if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if N%2==1: #奇数文字の時は無理
    print("No")
else:
    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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

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

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

    return



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

Submission status: Accepted

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

Submission status: Accepted

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