peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

s = [_ for _ in input()]
t = [_ for _ in input()]

for i in range(len(s)):
  s = [s[-1]] + s[:-1]
  if s==t:
    print('Yes')
    exit()
print('No')
# Judge status: Wrong Answer
N,M=map(int,input().split())
a=[0]*N
for i in range(M):
    a[int(input())]=1
MOD = 1000000007

dp=[0]*(N+1)
dp[0]=1
if 1 in a:
    dp[1]=0
else:dp[1]=1

for i in range(2,N+1):
    #n-1段目が安全なら
    if a[i-1]==0:
        dp[i]+=dp[i-1]
    #n-2段目が安全なら
    if a[i-2]==0:
        dp[i]+=dp[i-2]
    dp[i] = dp[i]%MOD
print(dp[N])
# Judge status: Accepted
S = input()
cnt = 0
for i in range(len(S)):
    if S[i]!=S[len(S)-1-i]:
        cnt += 1
print(cnt//2)
# Judge status: Accepted
a=int(input())
b=int(input())
if a%500 <= b:
  print('Yes')
else: print('No')
# Judge status: Accepted
n = int(input())
t = {"AC":0, "WA":1, "TLE":2, "RE":3}
u = ["AC", "WA", "TLE", "RE"]
ans = [0]*4
for _ in range(n):
    ans[t[input()]] += 1
for i in range(4):
    print(u[i], "x", ans[i])
# Judge status: Wrong Answer
from collections import Counter
n, k = map(int, input().split())
A = Counter(list(map(int, input().split())))
B = sorted(A.items())
if len(A) > k:
  print(n-sum(B[i][1] for i in range(k)))
else:
  print(0)
# Judge status: Accepted
import sys
input=sys.stdin.readline #文字列入力はするな！！
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]*=-1
a=sorted(a)
for i in range(m):
    h=-heapq.heappop(a)
    h=h//2
    heapq.heappush(a,-h)
print(-sum(a))
# Judge status: Accepted
n = int(input())
a = list(input())
wcnt,ecnt,ans,box = 0,0,0,[]
W = a.count("W")
E = a.count("E")
for i in range(n-1):
  if a[i] == "W":
    box.append(E+wcnt)
    wcnt += 1
    W -= 1
  else:
    box.append(E+wcnt)
    ecnt += 1
    E -= 1
if a[n-1] == "W":
  W -= 1
  box.append(E+wcnt)
  wcnt += 1
else:
  E -= 1
  box.append(E+wcnt)
  ecnt += 1
print(min(box))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a_0 = [0 for i in range(n)]

for i in a:
    a_0[i-1]+=1

for i in a_0:
    print(i)
# Judge status: Accepted
def main():
    N, K = list(map(int, input().split()))

    haved = [0] * N
    ans = 0
    for i in range(1, K+1, 1):
        d = int(input())
        ai = list(map(int, input().split()))
        for j in range(0, d, 1):
            x = ai[j] - 1
            haved[x] = haved[x] + 1

    for i in range(0, N, 1):
        if haved[i] == 0:
            ans = ans+1

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans = gcd(ans, A[i])
print(ans)
# Judge status: Accepted
from collections import Counter
import sys
N = int(input())
A = [int(x) for x in input().split()]

C = dict(Counter(A))
for a in C:
    if C[a] > 1:
        print('NO')
        sys.exit()
print('YES')
# Judge status: Accepted
s = input()
for i in range(len(s)):
    if s[i] == "A":
        l = i
        break
for i in range(len(s)-1, -1, -1):
    if s[i] == "Z":
        r = i
        break
print(r-l+1)
# Judge status: Accepted
s = input()

print(s[0],end="")
print(s[1],end="")
print(s[2],end="")
# Judge status: Accepted
n=int(input());s=input()
b=0
w=s.count('.')
ans=w
for si in s:
  b+=(si=='#')
  w-=(si=='.')
  ans=min(ans,b+w)
print(ans)
# Judge status: Accepted
N,T=map(int, input().split())
C=[]
for n in range(N):
    c,t=map(int,input().split())
    if t<=T:
        C.append(c)
print("TLE" if not C  else min(C))
# Judge status: Wrong Answer
N=int(input())
s=[]
for i in range(N):
    s+=[input()]
M=int(input())
t=[]
for i in range(M):
    t+=[input()]
ans1=0
for i in range(len(set(s))):
    ans=s.count(s[i])-t.count(s[i])
    ans1=max(ans1,ans)
if ans1<0:
    print(0)
    exit()
print(ans1)
# Judge status: Accepted
w,a,b = map(int, input().split())
print(0 if abs(a-b) <= w else abs(a-b)-w)
# Judge status: Accepted
def main():
    N, x = map(int, input().split())
    A = list(map(int, input().split()))
    cnt = 0
    for i in range(1,N):
        tmp = A[i] + A[i-1]
        if tmp > x:
            tmp -= x
            cnt += tmp
            A[i] = max(0, A[i]-tmp)

    print(cnt)

if __name__ == "__main__":
    main()
# Judge status: Accepted
from math import factorial
a, b = [int(i) for i in input().split()]
if abs(a-b) > 1:
    print(0)
elif a == b:
    print((2 * factorial(a) * factorial(b)) % (10 ** 9 + 7))
else:
    print((factorial(max(a, b)) * factorial(min(a, b))) % (10 ** 9 + 7))
# Judge status: Wrong Answer
n = int(input())
*a, = map(int,input().split())
a.reverse()
b = [a[0]]
for i in range(1,n+1):
    b.append(b[-1] + a[i])
b.reverse()
c = [0 for _ in range(n+1)]; c[0] = 1
ans = -1
for i in range(1,n+1):
    c[i] = min(c[i-1]*2,b[i])
    c[i] -= a[i]
    if i < n and c[i] <= 0 or i == n and c[i] < 0:
        print(-1);exit()
print(sum(c) + sum(a[1:]))
# Judge status: Wrong Answer
import math
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    POS = [list(map(int, input().split())) for i in range(N)]
    DIS = [[0]*(N) for _ in range(N)]
    M = 1
    for i in range(1,N+1):
        M *= i
    for i in range(N):
        for j in range(N):
            DIS[i][j] = math.sqrt((POS[i][0] - POS[j][0])**2 +(POS[i][1] - POS[j][1])**2)
    print(sum(map(sum, DIS))*(N-1)/M)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(1,N):
    tmp=a[i-1]+a[i]
    if tmp>x:
        ans+=tmp-x
        if a[i]>=tmp-x:
            a[i]-=tmp-x
        else:
            a[i]=0
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
if n%2 == 1:
  for i in range(m):
    print(m-i, m+1+i)
else:
  for i in range(m):
    if 4*(i+1) > n:
      print(m-i, m+2+i)
    else:
      print(m-i, m+1+i)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
num_sum = 0
num_min = abs(a[0])
num_minus = 0

for i in range(n):
    if (a[i] <= 0):
        num_minus += 1
    num_min = min(num_min, abs(a[i]))
    num_sum += abs(a[i])

if (num_minus % 2 == 0):
    print (num_sum)
else:
    print(num_sum-num_min*2)
# Judge status: Accepted
X = [0] * 5

for c in range(5):
    ABC = input()
    X[c] = [int(ABC), int(ABC[-1])]
    if X[c][1] == 0:
        X[c][1] = 10
        X[c].append(X[c][0])
    else:
        X[c].append(X[c][0] + (10 - X[c][1]))

X.sort(reverse=True, key=lambda val:val[1])

ans = sum([X[x][2] for x in range(4)]) + X[4][0]

print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
import numpy as np

N=int(input().rstrip('\n'))
A=np.array([int(x) for x in input().rstrip('\n').split()])
res = 0
for i in range(60):
  n = sum(A%2)
  A = A//2
  t = 2**i
  res += n*(N-n)*t
  res = res%(7+10**9)
  if all(x==0 for x in A):
    break
print(res)
# Judge status: Accepted
T = input()
print(T.replace('?', 'D'))
# Judge status: Accepted
h=int(input())
#a,b,x=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

i=0
count=1
while h>1:
    i+=1
    count+=2**i
    h=h//2

print(count)
# Judge status: Wrong Answer
import numpy
n=int(input(''))
b=numpy.zeros((n+1,1),dtype=int)


for a in range(1,n+1):
    c=0
    while(1):
        if a+a*c<=n:
            b[a+a*c][0]+=1
            c+=1
        else:
            break


q=[numpy.arange(0,n+1,dtype=int)]


s=numpy.dot(q,b)
print(s[0])
# Judge status: Accepted
s = int(input())

x = (10**9 - s%10**9)%10**9
y = (s+x)//10**9
print(0,0,10**9,1,x,y)
# Judge status: Wrong Answer
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]
ans=[]
for i in set(s):
    ans.append(s.count(i)-t.count(i))
print(max(ans))
# Judge status: Wrong Answer
list=[1, 1, 1, 1, 1]
for i in range(1, 7):
  list.append(6**i)
for j in range(1, 7):
  list.append(9**i)
sorted(list, reverse=True)
N=int(input())
count=0
for i in list:
  if i <= N:
    N=N-i
    count+=1
    if N == 0:
      print(count)
# Judge status: Accepted
import math
a,b = list(map(int,input().split()))
print(math.ceil((a+b)/2))
# Judge status: Wrong Answer
a=int(input())
b=a//2
if b==1:
  b=b+1
print(b)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
n = 0
can = True

while can:
    for i in range(N):
        if A[i]%2 == 0:
            A[i] = (A[i]/2)
            n += 1
        else:
            can = False
            break

print(n)
# Judge status: Wrong Answer
k,s= map(int,input().split())
ans=0
for i in range(k):
  for j in range(k):
    z=s-i-j
    if 0<=z<=k:
      ans+=1
print(ans)
# Judge status: Accepted
import sys
#input = sys.stdin.readline

def main():
    n=int(input())
    a=list(map(int,input().split()))
    l=[0]*(n+1)
    s=0
    for i in range(n):
        l[a[i]]+=1
    for i in range(n+1):
        if l[i]==0:
            continue
        else:
            s+=l[i]*(l[i]-1)//2
    for i in range(n):
        print(s-(l[a[i]]-1))

if __name__ == '__main__':
    main()
# Judge status: Accepted
sa=list(input())
sb=list(input())
sc=list(input())

sa_rev=sa[::-1]
sb_rev=sb[::-1]
sc_rev=sc[::-1]

turn="a"
while True:
  if turn=="a":
    if not sa_rev:
      print("A")
      break
    else:
      turn=sa_rev.pop()
  elif turn=="b":
    if not sb_rev:
      print("B")
      break
    else:
      turn=sb_rev.pop()
  elif turn=="c":
    if not sc_rev:
      print("C")
      break
    else:
      turn=sc_rev.pop()
# Judge status: Accepted
a,b=map(int,input().split())

if a>8 or b>8:
  print(":(")
else:
  print("Yay!")
# Judge status: Accepted
n = int(input())

d = {}
for i in range(n):
  s = input()
  if s in d:
    d[s] += 1
  else:
    d[s] = 1

m = max(d.values())
ans = []

for k, v in d.items():
  if v == m:
    ans.append(k)
ans.sort()
print(*ans, sep = "\n")
# Judge status: Accepted
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
A.sort()
ma = max(A)

prime = [0 for i in range(ma)]

for a in A:
    for j in range(a, ma+1, a):
        prime[j-1] += 1

cnt = 0
for i in A:
    if(prime[i-1] == 1):
        cnt += 1
       
print(cnt)
# Judge status: Wrong Answer
A = [[0] * 3 for _ in range(3)]
for i in range(3):
  A[i] = list(map(int, input().split()))

N = int(input())
for _ in range(N):
  b = int(input())

  for i in range(3):
    for j in range(3):
      if A[i][j] == b:
        A[i][j] = -1

ans = "No"
for i in range(3):
  if A[i] == [-1] * 3 or A[:][i] == [-1] * 3:
    ans = "Yes"

if [A[0][0], A[1][1], A[2][2]] == [-1] * 3 or [A[0][2], A[1][1], A[2], 0] == [-1] * 3:
  ans = "Yes"

print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
total=sum(a)
c=0
for i in a:
    if i>=(total/(4*m)):
        c+=1
    if c==m:
        print('Yes')
        exit()

print('No')
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))
c=0

for i in range(N-1):
  if A[i]>A[i+1]:
    c=c+(A[i]-A[i+1])
    A[i+1]=A[i]

print(c)
# Judge status: Accepted
q,h,s,d = map(int,input().split())
n = int(input())
print(min(q*n*4,h*n*2,s*n,(n//2)*d+(n%2)*s,(n//2)*d+(n%2)*h*2,(n//2)*d+(n%2)*q*4))
# Judge status: Accepted
N, = list(map(int,input().split()))
a  = list(map(int,input().split()))
s = set()
c6=0
for ai in a:
    if ai>=3200:
        c6 += 1
    else:
        s |= set({ai//400})
print(max(1,len(s)),len(s)+c6)
# Judge status: Accepted
n = int(input())
r = 0
for p in range(2, int(n**0.5)+1):
    e = 0
    while n%p == 0:
        e += 1
        n /= p
    i = 1
    while e >= i:
        e -= i
        r += 1
        i += 1
if n != 1:
    r += 1
print(r)
# Judge status: Accepted
A,B,C = sorted(map(int,input().split()))[::-1]
print(A*10+B*1+C)
# Judge status: Accepted
import sys
input = sys.stdin.readline
a,b,c = [int(i) for i in input().split()]
if b - a == c - b :
    print("YES")
else :
    print("NO")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
x=b[n//2-1]
y=b[n//2]
for i in a:
    if i<=x:
      print(y)
    else:
      print(x)
# Judge status: Accepted
N, K = map(int, input().split())
H    = list(map(int, input().split()))

H = sorted(H, reverse=True)

print(sum(H[K:]))
# Judge status: Accepted
N = int(input())
S = input()
new_S = ''
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

for s in range (len(S)):
    for i in range(26):
        if (S[s] == alphabet[i]):
            new_S += alphabet[i+N]
            break
print(new_S)
# Judge status: Accepted
a, b, c = map(int, input().split())
ans = 0

while True:
    if a%2==1 or b%2==1 or c%2==1:
        print(ans)
        break
    if a == b == c:
        print(-1)
        break
    s = a // 2
    t = b // 2
    u = c // 2
    a, b, c = t+u, s+u, s+t
    ans += 1
else:
    print(ans)
# Judge status: Accepted
S = input()
T = input()
answer = False

for i in range(len(S)):
    S = S[-1] + S[:-1]
    if S == T:
        answer = True

if answer:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m = iim()
if m == 1:
    print(1,2)
elif n%2 == 1:
    l = list(range(1,n//2+1))[::-1]
#    print(l)
    for i in l[:m]:
        print(i,n-i)
else:
    for i in range(1,m):
        print(i,n-1)
    print(m,n//2)
# Judge status: Accepted
n,l = map(int, input().split())
print("".join(sorted([input() for _ in range(n)])))
# Judge status: Accepted
A,B,K=map(int, input().split())

if A>=K:
	print(A-K, B)

else:
	if A+B>=K:
		print(0,B-(K-A))
	else:
		print(0,0)
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = list(a.items())
a.sort(reverse=True)
e1 = 0
e2 = 0
for i in range(len(a)):
    if a[i][1] >= 4 and e1 == 0:
        e1 = e2 = a[i][0]
        break
    elif a[i][1] >= 2:
        if e1 == 0:
            e1 = a[i][0]
        else:
            e2 = a[i][0]
            break
print(e1*e2)
# Judge status: Accepted
x,y = map(int,input().split())
if x*y >= 0:
    if x == 0:
        if y < 0:
            print(1-y)
        else:
            print(y)
    elif y == 0:
        if x > 0:
            print(1+x)
        else:
            print(-x)
    elif x > y:
        print(2+x-y)
    else:
        print(y-x)
else:
    if x >= -y:
        print(1+x+y)
    else:
        print(1-x-y)
# Judge status: Accepted
k,s = map(int,input().split())

count = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if z >= 0 and k >= z:
            count += 1
            
print(count)
# Judge status: Accepted
n,m = map(int,input().split())
people = [list(map(int,input().split())) for _ in range(n)]

matrix = [[ False for _ in range(n)] for _ in range(m)]
#横が人，縦がしなもの


for person_id in range(n):
    person = people[person_id]
    for konomi_num in person[1:]:
        matrix[konomi_num-1][person_id] = True
ans = 0
for food in range(m):
    if all(matrix[food]):
        ans += 1
print(ans)
# Judge status: Wrong Answer
import math

a,b,c=map(int,input().split())

if((math.sqrt(a)+math.sqrt(b))<math.sqrt(c)):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
L=[int(i) for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2==0):
    count+=1
print(count)
# Judge status: Accepted
X, Y, Z = map(int, input().split())
i = 0
width = Z
while True :
    width += Y + Z
    i += 1
    if X < width:
        break
print(i - 1)
# Judge status: Accepted
n =int(input())
print((n - n//2) / n)
# Judge status: Accepted
# https://atcoder.jp/contests/agc005/tasks/agc005_a

x = input()
ans = len(x)
stack = []
for i in range(len(x)):
    if x[i] == 'S':
        stack.append(x[i])
    elif x[i] == 'T' and stack:
        ans -= 2
        stack.pop()
print(ans)
# Judge status: Wrong Answer
[N, x] = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
count = 0
i = 0
while x >= 0 and i <= len(a):
  x -= a[i]
  if i == len(a)-1:
    if x != a[i]:
      break
  if x >= 0:
    count += 1
  i += 1
  
print(count)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int, input().split()))
sv = h[n-1]
ok = True
for i in range(n-1):
    if h[i] - sv >= 2:
        ok = False

if ok:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,A,B = map(int, input().split())

counter = 0
for i in range(1,N+1):
    if A <= sum(map(int, str(i))) <= B:
        counter += i
print(counter)
# Judge status: Wrong Answer
s = [int(i) for i in input().split(' ')]

n = [0] * 2

for i in s:
    if i == 5:
        n[0] += 1
    elif i == 7:
        n[1] += 1

if n[0] == 2 and n[1] == 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

X, N = ri_()
p = ri_()
d = 1000
ans = 1000
for i in range(-500, 501):
    f = 1
    for pi in p:
        if i == pi:
            f = 0
    if f == 1 and d > abs(X - i):
        d = abs(X - i)
        ans = i
print(ans)
# Judge status: Accepted
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    S = input()
    print(S[:3])


if __name__ == "__main__":
    main()
# Judge status: Accepted
N,K=map(int,input().split())
L=[]
for i in range(N):
    L.append(int(input().rstrip()))
L.sort()
M=[]
for i in range(N-K+1):
    M.append(L[K+i-1]-L[i])
M.sort()
print(M[0])
# Judge status: Accepted
# B - ss
def main():
    s = list(input())

    for _ in range(len(s)):
        s.pop()
        if len(s) % 2 == 0:
            p = len(s)//2
            if s[0:p] == s[p:]:
                print(len(s))
                exit()


if __name__ ==  "__main__":
    main()
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
 
ans=0
for i in range(N):
    if i%2!=0 and a[i]%2!=0:
        ans+=1
        
print(ans)
# Judge status: Wrong Answer
import sys
S = input()

for i in range(1, len(S)):
  s = S[:-i]
  l = len(s) // 2
  if s[:l] == s[l:]:
    print(len(s))
# Judge status: Wrong Answer
S, W = map(int, input().split())

if W >= S / 2:
  print('unsafe')
else:
  print('safe')
# Judge status: Accepted
s = list(input())
result = []
for word in s:
  if word == 'B':
    if result != []:
      result.pop()
  else:
    result.append(word)
print(''.join(result))
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if x==500*i+100*j+50*k:
        ans+=1
print(ans)
# Judge status: Accepted
a, b = list(map(int, input().split()))
s = list(input())
na = "".join(s[: a]).isdigit()
nb = "".join(s[a + 1 :]).isdigit()
hf = s[a]
print("Yes") if na and nb and hf == "-" else print("No")
# Judge status: Accepted
N, M = map(int, input().split())
shops = [tuple(map(int, input().split())) for _ in range(N)]
shops.sort()
cost = 0
for shop in shops:
    value, amount = shop
    if amount < M:
        cost += value * amount
        M -= amount
    else:
        cost += value * M
        break
print(cost)
# Judge status: Accepted
N = int(input())
c = [[0 for i in range(10)] for j in range(10)]
for i in range(1,N+1):
    stri = str(i)
    c[int(stri[0])][int(stri[-1])] += 1
ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += c[i][j]*c[j][i]
print(ans)
# Judge status: Accepted
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,x,t=mp()
print(((n-1)//x+1)*t)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
tmp = 0
for i in range(n):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            tmp += 1
if tmp == 0:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
X=int(input())
from math import gcd

ans=360//gcd(X, 360)
print(ans)
# Judge status: Accepted
S = input()
for i in range(1, len(S)+1):
    if (i % 2 == 1 and S[i-1] == "L") or (i % 2 == 0 and S[i-1] == "R"):
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
from collections import Counter
_, *lst = map(int, open(0).read().split())
stick = [i for i, j in Counter(lst).items() if j > 1]
if len(stick) > 1:
  stick.sort()
  print(stick[-1] * stick[-2])
else:
  print(0)
# Judge status: Accepted
a,b=input().split()
ab=int(a+b)
ans=0
for i in range(350):
	if ab**(1/2)==i:
	    print("Yes")
	    ans+=1
	    quit()
if ans==0:
  print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())

P = {'s':R, 'p':S, 'r':P, 'N':0}

score = 0

for i in range(N):
    if i + K < N:
        if T[i] == T[i + K]:
            T[i + K] = 'N'
    
    score += P[T[i]]

print(score)
# Judge status: Accepted

n = int(input())

ans = 0

for i in range(1,n+1):
    lim = n//i
    ans += lim*(lim+1)*i//2

print(ans)
# Judge status: Accepted
from collections import deque

n, m = map(int, input().split())
rooms = [[] for i in range(n + 1)]

for i in range(m):
    a, b = map(int, input().split())
    rooms[a].append(b)
    rooms[b].append(a)

q = deque()
q.append(1)
paths = [-1]*(n + 1)
paths[1] = 0

while q:
    rnum = q.popleft()
    for i in rooms[rnum]:
        if paths[i] == -1:
            paths[i] = rnum
            q.append(i)
print("Yes")
for i in paths[2:]:
    print(i)
# Judge status: Wrong Answer

#!/usr/bin/env python
from typing import List


def input_int() -> int:
    return int(input())


def input_list_int() -> List[int]:
    return list(map(lambda x: int(x), input().split()))


def f(n: int) -> int:
    ans = 0
    for a in range(1, n - 1):
        ans += (n - 1) // a
    return ans


if __name__ == '__main__':
    n = input_int()
    print(f(n))
# Judge status: Accepted
a, b = map(int, input().split())

if a < b:
  print(str(a) * b)
else:
  print(str(b) * a)
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

print((a+b) * h // 2)
# Judge status: Accepted
N = int(input())
S = input()

r_num = S.count("R")
g_num = S.count("G")
b_num = S.count("B")

cnt = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        if not 2 * j - i < N:
            break
        if S[i] != S[j] and (S[2 * j - i] != S[i] and S[2 * j - i] != S[j]):
            cnt += 1

ans = r_num * g_num * b_num - cnt
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(n//7 + 1):
    if (n - 7*i) % 4 == 0:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
N, K =map(int, input().split())
snuke = [0]*N

for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        snuke[j] = 1

print(snuke.count(0))
# Judge status: Wrong Answer
n = int(input())
x = list(map(int, input().split()))
s = sum(x)
p = (s+n-1)/n
r = 0
for y in x:
    r += (y - p)**2
print(r)
# Judge status: Wrong Answer
S = input()
T = input()
counter_dict = {}

for i in range(len(S)):
	counter = 0
	for j in range(len(T)):
		if i + j < len(S):
			if S[i + j] == T[j]:
				counter += 1
	if str(i) in counter_dict.keys():
		if counter_dict[str(i)] < counter:
			counter_dict[str(i)] = counter
	else:
		counter_dict[str(i)] = counter
max_counter = max(counter_dict.values())
print(len(T) - max_counter)
# Judge status: Accepted
from math import *
s=int(input())
x1=ceil(sqrt(s))
if x1>10**9:
    x1-=1
y2=ceil(s/x1)
if y2>10**9:
    y2-=1
x2=x1*y2-s
print(0,0,x1,1,x2,y2)
# Judge status: Accepted
s = list(map(int, input()))
k = int(input())
res = 1
n = 0
for i in range(len(s)):
    if s[i] != 1:
        res = s[i]
        n = i + 1
        break
if k < n:
    print(1)
else:
    print(res)