x = int(eval(input()))

s = eval(input())

if x%2 ==1 or s[:x//2] != s[x//2:]:

	print('No')

else:

	print('Yes')
l = int(eval(input()))

s = eval(input())



if s == s[:l//2] + s[:l//2]:

	print('Yes')

else:

	print('No')
x = int(eval(input()))
s = eval(input())
if x % 2 == 1 or s[: x // 2] != s[x // 2 :]:
    print("No")
else:
    print("Yes")

l = int(eval(input()))
s = eval(input())
if s == s[: l // 2] + s[: l // 2]:
    print("Yes")
else:
    print("No")

-x = int(eval(input())) +l = int(eval(input())) -if x % 2 == 1 or s[: x // 2] != s[x // 2 :]: +if s == s[: l // 2] + s[: l // 2]: +    print("Yes") +else: -else: -    print("Yes")