def A():
N = int(input())
S = input()
if N == 1:
print("Yes")
else:
print("Yes" if len(set(S[0::2])) == 1 and len(set(S[1::2])) == 1 else "No")test_all(A)
def A2():
N = int(input())
S = input()
if N == 1:
print("Yes")
else:
print(
"Yes"
if len(set(S[0::2])) == 1
and len(set(S[1::2])) == 1
and len(set(S[:2])) == 2
else "No"
)test(A2, wa_case)test_all(A2)
def D():
import math
N, M = map(int, input().split())
if N * N < M:
print(-1)
# exit()
return
if M <= N:
print(M)
# exit()
return
X = float("inf")
rootM = int(M ** (1 / 2))
for a in range(math.ceil(M / N), rootM + 1):
b, m = divmod(M, a)
if m == 0:
print(M)
# exit()
return
X = min(X, a * (b + 1))
print(X)test_all(D)
def D():
import math
N, M = map(int, input().split())
if N * N < M:
print(-1)
# exit()
return
if M <= N:
print(M)
# exit()
return
X = float("inf")
rootM = int(M ** (1 / 2))
for a in range(math.ceil(M / N), rootM + 2):
b, m = divmod(M, a)
if m == 0:
print(M)
# exit()
return
X = min(X, a * (b + 1))
print(X)test_all(D)
def D():
import math
N, M = map(int, input().split())
if N * N < M:
print(-1)
# exit()
return
if M <= N:
print(M)
# exit()
return
X = float("inf")
rootM = int(M ** (1 / 2))
for a in range(math.ceil(M / N), N + 1):
b, m = divmod(M, a)
if m == 0:
print(M)
# exit()
return
if a > (b + 1):
break
X = min(X, a * (b + 1))
print(X)test_all(D)