Harryxun/stf_run huggingface dataset:
N=int(input())
A=list(map(int, input().split()))
A=sorted(A)
if N%3!=0:
  if A==[0]*N:
    print('Yes')
  else:
    print('No')
else:
  B=A[0]+A[1]
  for i in range(N):
    d=B[i]^B[i+1]^B[i+2]
    if d!=0:
      print('No')
      exit()
  print('Yes')

### FIXED CODE ###

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

a=A[0]
for i in range(N-1):
  a=a^A[i+1]
if a==0:
  print("Yes")
else:
  print("No")
if n == 1:
  for i in range(10):
    i = str(i)
    for s, c in sc:
      if i == str(c):
        flag = True 
      else:
        flag = False
        break 
    if flag:
      print(''.join(i))
      exit()

for i in range(10**(n-1), 1000):
  i = list(str(i))
  flag = False
  for s,c in sc:
    if i[s-1] == str(c):
      flag = True
    else:
      flag = False
      break
  if flag:
    print(''.join(i))
    exit()

print('-1')

### FIXED CODE ###

N, M = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(0, 1000):
  i = str(i)
  flag = True
  if len(i) != N:
    continue
  for s, c in sc:
    #print(i, s, len(i))
    if len(list(i)) < s:
      flag = False
      break
    if i[s-1] != str(c):
      flag = False
      break
  if flag:
    print(i)
    exit()

print(-1)
a = [int(i) for i in input().split()]
" ".join(map(str,a.sort()))

### FIXED CODE ###

a = [int(i) for i in input().split()]
a.sort()
print(a[0],a[1],a[2])
n = int(input())
x = 0
for i in range(n):
    x = max(int(input()), x)
print("first" if sum % 2 == 1 else "second")

### FIXED CODE ###

n = int(input())
a = [0] * n
flag = True
for i in range(n):
    a[i] = int(input())
    if a[i] % 2 == 1:
        flag = False
print("second" if flag else "first")
import fractions
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0

N,M = (int(x) for x in input().split())
a = list(map(int, input().split()))
temp = [a[0],a[0]//2]
broke = False
for i in range(1,N):
    gcd = xgcd(temp[0],a[i])
    if temp[1] % gcd[0] != (a[i]//2) % gcd[0]:
        broke = True
        break
    else:
        x = temp[1] + temp[0]*((a[i]//2)-temp[1])//gcd[0]*gcd[1]
        temp[0] = (temp[0] * a[i]) // math.gcd(temp[0], a[i])
        temp[1] = x % temp[0]
if broke:
    print('0')
else:
    dm = divmod(M,temp[0])
    if dm[1] >= temp[1]:
        print(dm[0]+1)
    else:
        print(dm[0])

### FIXED CODE ###

import fractions
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0

N,M = (int(x) for x in input().split())
a = list(map(int, input().split()))
temp = [a[0],a[0]//2]
broke = False
for i in range(1,N):
    gcd = xgcd(temp[0],a[i])
    if temp[1] % gcd[0] != (a[i]//2) % gcd[0]:
        broke = True
        break
    else:
        x = temp[1] + temp[0]*((a[i]//2)-temp[1])//gcd[0]*gcd[1]
        temp[0] = (temp[0] * a[i]) // fractions.gcd(temp[0], a[i])
        temp[1] = x % temp[0]
if broke:
    print('0')
else:
    dm = divmod(M,temp[0])
    if dm[1] >= temp[1]:
        print(dm[0]+1)
    else:
        print(dm[0])
from scipy.special import comb
n, m = map(int, input().split())
# nC2+mC2を求めればよい
print(comb(n, 2, exact=True) + comb(m, 2, exact=True))


### FIXED CODE ###

from scipy.misc import comb
n, m = map(int, input().split())
# nC2+mC2を求めればよい
print(comb(n, 2, exact=True) + comb(m, 2, exact=True))
import math
N = int(input())
D = int(input())
i = N / (2*D + 1)
if 1 <= N <= 20 and 1 <= D <= 20:
    if i > 0:
        i = math.ceil(i)
        print(i)



### FIXED CODE ###

import math
N, D = map(int, input().split())
i = N / (2*D + 1)
if 1 <= N <= 20 and 1 <= D <= 20:
    if i > 0:
        i = math.ceil(i)
        print(i)
answer='No'
for i in str(N):
  if i==7:
    print(answer)
return answer

### FIXED CODE ###

n=input()

if '7' in str(n):
  print('Yes')
else:
  print('No')
import math
from functools import reduce
N, X = map(int, input().slpit())
x = [int(input()) for i in range(N)]

for i in range(N):
    x[i] = abs(x[i]-X)

x = sorted(x)[::-1]
cnt = 0

for i in range(N):
    cnt = math.gcd(cnt, x[i])

print(cnt)

### FIXED CODE ###

import math
from functools import reduce
N, X = map(int, input().split())
x = list(map(int,input().split()))
 
for i in range(N):
    x[i] = abs(x[i]-X)
 
x = sorted(x)[::-1]
cnt = 0
 
for i in range(N):
    cnt = math.gcd(cnt, x[i])
 
print(cnt)
import math
N,M = int(input())
if(N == 1 or M == 1):
  print("0")
else:
  print(str(((math.factorial(N) * math.factorial(M))% 10 ** 9 + 7)))

### FIXED CODE ###

import math
N,M = map(int,input().split())
if(abs(N - M) >= 2):
  print("0")
else:
  if(N != M):
    print(str(((math.factorial(N) * math.factorial(M)) % (10 ** 9 + 7))))
  else:
    print(str(((math.factorial(N) * math.factorial(M))* 2 % (10 ** 9 + 7))))
#!/usr/bin python3
# -*- coding: utf-8 -*-

n, k = map(int, input().split())
p = [int(i)-1 for i in input().split()]
c = list(map(int, input().split()))

rc = [0] * n
rp = [0] * n

for i in range(n):
    if rc[i]!=0:
        continue
    else:
        nw = set([i])
        np = c[i]
        nx = p[i]
        while not nx in nw:
            nw.add(nx)
            np += c[nx]
            nx = p[nx]
        cnt = len(nw)
        for x in nw:
            rc[x] = cnt
            rp[x] = max(0, np)
ret = - 10 ** 18
for i in range(n):
    pseq = [0]
    nx = p[i]
    for j in range(1,rc[i]+1):
        pseq.append(pseq[-1]+c[nx])
        nx = p[nx]
    pseq = pseq[1:]
    if k <= rc[i]:
        ret = max(ret, max(pseq[:k]))
    elif rp[i] < 0:
        ret = max(ret, max(pseq))
    else:
        tmp = max(pseq)
        tmp = max(tmp, rp[i] + max(pseq[:k%rc[i]]))
        tmp += rp[i]*(k//rc[i]-1)
        ret = max(ret, tmp)
print(ret)

### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

n, k = map(int, input().split())
p = [int(i)-1 for i in input().split()]
c = list(map(int, input().split()))

ret = - 10 ** 18
for s in range(n):
    nxt = p[s]
    S = [c[nxt]]
    while nxt != s:
        nxt = p[nxt]
        S.append(S[-1]+c[nxt])

    if k<=len(S):
        pt = max(S[:k])
    else:
        if S[-1] <= 0:
            pt = max(S)
        else:
            pt = max(S)
            if k%len(S)!=0:
                pt = max(pt, S[-1]+max(S[:k%len(S)]))
            pt += S[-1]*(k//len(S)-1)
    ret = max(ret, pt)
print(ret)
import math
r = int(input())
print("{0:f} {1:f}".format(r**2 * math.pi, 2 * r * math.pi))



### FIXED CODE ###

import math
r = float(input())  #入力値が実数の時
print("{0} {1}".format(r**2 * math.pi, 2 * r * math.pi))
S=input()
for i in range(len(S)-1):
  cnt=0
  if S[i]!=S[i+1]:
    cnt+=1
print(cnt)
    

### FIXED CODE ###

S=input()
cnt=0
for i in range(len(S)-1):
  if S[i]!=S[i+1]:
    cnt+=1
print(cnt)
a=int(input())

b=int(input())

if(0<=a<=9 & 0<=b<=9):
    print(a*b)

else:
    print(-1)
  
  
  

### FIXED CODE ###


a,b = list(map(int, input().split()))
  
if(1<=a<=9 and 1<=b<=9):
    print(a*b)

else:
    print(-1)
S = 46797
s = 46797
a = int(h = (S / 3600), m = ((S % 3600) / 60), for s in range(0, 60))
print('a')

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60

print("{0}:{1}:{2}".format(h,m,s))
# D - Score Attack
import sys
sys.setrecursionlimit(10 ** 9)

import numpy as np
from heapq import heappush, heappop

N, M, = map(int, input().split())
graph = [[] for _ in range(N+1)] # graph[0]は使わない

for _ in range(M):
    a, b, c = map(int, input().split())
    graph[a].append((b, -c)) # ヒープ構造を使うため重みはマイナスの値

def dijkstra(start, co):
    INF = float('inf')
    dist = [INF] * (N+1) # dist[0]は使わない
    dist[start] = 0
    que = [(0, start, co)] # queではscoreを先頭に
    while que:
        score, place, count = heappop(que) # placeは現在地
        if score > dist[place] or count > 3000: # 前来た時より点数が悪いか、無限ループしている場合continue
            continue
        for next_node, weight in graph[place]:
            score2 = score + weight
            if next_node == N and count > 1000: # いくらでも大きくなる場合
                print('inf')
                exit()
            if dist[next_node] > score2: # 点数が良くなるなら、データを更新
                dist[next_node] = score2
                heappush(que, (score2, next_node, count+1))
    return dist

d1 = np.array(dijkstra(1, 0))
print(-int(d1[N]))

### FIXED CODE ###

import sys

INF = float('inf')

def Bellmanford(n, edges, r): #r: 始点
    d = [INF] * n
    d[r] = 0
    
    for i in range(n):
        for (u, v, c) in edges:
            if d[u] != INF and d[u] + c < d[v]:
                d[v] = d[u] + c
                if i == n-1 and v == n-1:
                    return 'inf'
    
    return -d[n-1]
    

N, M = map(int, sys.stdin.readline().split())
Edges = [None] * M

for i in range(M):
    ai, bi, ci = map(int, sys.stdin.readline().split())
    Edges[i] = (ai-1, bi-1, -ci)
    
ans = Bellmanford(N, Edges, 0)

print(ans)
S = input()
count = 0
res = []
for i in range(len(S)):
    if S[i] in ["A", "C", "G", "T"]:
        count += 1
    else:
        res.append(count)
        count = 0
print(max(res, 0))


### FIXED CODE ###

s = input()
ans=0
now=0
for a in s:
    if a in ["A", "C", "G", "T"]:
        now+=1
    else:
        now=0
    ans=max(ans,now)
print(ans)
ans = 0

if X > 0:
    tmp = abs(X) % D
    if tmp  >= K:
        ans = X - D*K
    elif tmp < K:
        nK = K - tmp
        X1 = X- D*tmp
        X2 = X1 - D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
elif X < 0:
    tmp = abs(X) % D
    if tmp  >= K:
        ans = X + D*K
    elif tmp < K:
        nK = K - tmp
        X1 = X + D*tmp
        X2 = X1 + D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
else:
    if K %2 == 0:
        ans = 0
    else :
        ans = D
print(ans)

### FIXED CODE ###

X, K, D = map(int, input().split())
ans = 0

if X > 0:
    tmp = abs(X) // D
    if tmp  >= K:
        ans = X-D*K
        
    elif tmp < K:
        nK = K - tmp
        X1 = X- D*tmp
        X2 = X1 - D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
        
elif X < 0:
    tmp = abs(X) // D
    if tmp  >= K:
        ans = X + D*K
    elif tmp < K:
        nK = K - tmp
        X1 = X + D*tmp
        X2 = X1 + D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
else:
    if K %2 == 0:
        ans = 0
    else :
        ans = D
print(abs(ans))
a,b=map(int,input()split())
if(a*b)%2:
print("Odd")
eles:
print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
n,a,b,c,d=map(int,input().split())
s=input()
ans="Yes"
if c<b:
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
    if ans=="Yes":
        for i in range(b-1,d-1):
            if s[i]=="#" and s[i+1]=="#":
                ans="No"
                break
elif c<d:
    for i in range(a-1,d-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
else:
    cnt=0
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
    if ans=="Yes":
        for i in range(b-1,d):
            if s[i]==".":
                cnt+=1
                if cnt==3:
                    break
            else:
                cnt=0
        if cnt!=3:
            ans="No"
print(ans)n,a,b,c,d=map(int,input().split())
s=input()
ans="Yes"
if c<b:
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
    if ans=="Yes":
        for i in range(b-1,d-1):
            if s[i]=="#" and s[i+1]=="#":
                ans="No"
                break
elif c<d:
    for i in range(a-1,d-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
else:
    cnt=0
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
    if ans=="Yes":
        for i in range(b-1,d):
            if s[i]==".":
                cnt+=1
                if cnt==3:
                    break
            else:
                cnt=0
        if cnt!=3:
            ans="No"
print(ans)

### FIXED CODE ###

n,a,b,c,d=map(int,input().split())
s=input()
ans="Yes"
if c<b:
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
    if ans=="Yes":
        for i in range(b-1,d-1):
            if s[i]=="#" and s[i+1]=="#":
                ans="No"
                break
elif c<d:
    for i in range(a-1,d-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
else:
    cnt=0
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            ans="No"
            break
    if ans=="Yes":
        for i in range(b-2,d+1):
            if s[i]==".":
                cnt+=1
                if cnt==3:
                    break
            else:
                cnt=0
        if cnt!=3:
            ans="No"
print(ans)
N,K = map(int, input().split())
l = list(map(int,input().split()))
l.sort()
i  = 0
while(i<K):
	l[N-i-1] = 0
	i += 1
ans = sum(l)
print(ans)

### FIXED CODE ###

N,K = map(int, input().split())
l = list(map(int,input().split()))
l.sort()
i  = 0

if(K >= N):
  ans = 0
else:
  while(i<K):
    l[N-i-1] = 0
    i += 1
  ans = sum(l)
print(ans)
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def foo(x):
    b = []
    for i in range(n):
        b.append([x for x in a[i]])
    cnt = 0
    rem = [False]*m
    while cnt<n:
        top = [0]*m
        ok = True
        for i in range(n):
            top[b[i][-1]] += 1
        for j in range(m):
            if top[j]>x:
                ok = False
                rem[j] = True
                cnt += 1
                if cnt==n:
                    return False
        if ok:
            return True
        for i in range(n):
            while len(b[i])>0 and rem[b[i][-1]]:
                b[i].pop()
    return True

n,m = inm()
a = []
for i in range(m):
    aa = inl()
    aa = [x-1 for x in aa]
    aa.reverse()
    a.append(aa)
mx = n
mn = 0
while mx>mn+1:
    mid = (mx+mn)//2
    if foo(mid):
        mx = mid
    else:
        mn = mid
print(mx)


### FIXED CODE ###

from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True  and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def foo(x):
    b = []
    for i in range(n):
        b.append([y for y in a[i]])
    #ddprint(b)
    cnt = 0
    rem = [False]*m
    while cnt<m:
        #ddprint("in loop x {} cnt {} b, rem".format(x,cnt))
        #ddprint(b)
        #ddprint(rem)
        top = [0]*m
        ok = True
        for i in range(n):
            top[b[i][-1]] += 1
        for j in range(m):
            if top[j]>x:
                ok = False
                rem[j] = True
                cnt += 1
                if cnt==m:
                    return False
        if ok:
            return True
        for i in range(n):
            while len(b[i])>0 and rem[b[i][-1]]:
                b[i].pop()
    return True

n,m = inm()
a = []
for i in range(n):
    aa = inl()
    aa = [x-1 for x in aa]
    aa.reverse()
    a.append(aa)

ddprint(a)
mx = n
mn = 0
while mx>mn+1:
    mid = (mx+mn)//2
    if foo(mid):
        mx = mid
    else:
        mn = mid
print(mx)
S = int(input())
ans = S[0:3]
print(ans)

### FIXED CODE ###

S = input()
ans = S[0:3]
print(ans)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
aa = 10 * ((a + 9) // 10)
bb = 10 * ((b + 9) // 10)
cc = 10 * ((c + 9) // 10)
dd = 10 * ((d + 9) // 10)
ee = 10 * ((e + 9) // 10)
x = min(set([a%10,b%10,c%10,d%10,e%10]) - {0})
print(x)
print(aa+bb+cc+dd+ee-(10-x))


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
aa = 10 * ((a + 9) // 10)
bb = 10 * ((b + 9) // 10)
cc = 10 * ((c + 9) // 10)
dd = 10 * ((d + 9) // 10)
ee = 10 * ((e + 9) // 10)
if len(set([a%10,b%10,c%10,d%10,e%10]) - {0}) > 0:
    x = min(set([a%10,b%10,c%10,d%10,e%10]) - {0})
else:
    x = 10
# print(x)
print(aa+bb+cc+dd+ee-(10-x))
import bisect
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
 
 
def solve2():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            min_sum = L[i]+L[j]
            more_than = bisect.bisect_left(L[j+1:], min_sum)
            ans += more_than
    print(ans)
 
 
solve2()

### FIXED CODE ###

A,B = map(int, input().split())

if A <= 2*B:
  print(int(0))
else:
  print(A-2*B)
n = int(input())
cnt = [0] * n
ok = [[0] * (n - 1) for i in range(n)]
ans = []
for i in range(n - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    for j in range(n):
        if not ok[a][j] and not ok[b][j]:
            ans.append(j + 1)
            ok[a][j] = 1
            ok[b][j] = 1
            break
    cnt[a] += 1
    cnt[b] += 1
    
print(max(cnt))
print(*ans, sep = "\n")
    
    

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

from collections import deque
        
n = int(input())
uf = UnionFind(n)
g = [[] for i in range(n)]
cnt = [0] * n
ans = [0] * (n - 1)

for i in range(n - 1):
    a, b = map(lambda x:int(x) - 1, input().split())
    uf.union(a, b)
    g[a].append((b, i))
    g[b].append((a, i))
    cnt[a] += 1
    cnt[b] += 1
    

for i in uf.roots():
    visited = [0] * n
    visited[i] = 1
    que = deque()
    que.append([i, 0])
    while que:
        s = que.popleft()
        k = 0
        for j in g[s[0]]:
            if not visited[j[0]]:
                while True:
                    k += 1
                    if k != s[1]:
                        que.append([j[0], k])
                        visited[j[0]] = 1
                        ans[j[1]] = k
                        break

print(max(cnt))
print(*ans, sep = "\n")
import sys
from collections import Counter
n = int(input())
ls = []
for i in range(n):
    x, y = [int(i) for i in sys.stdin.readline().split()]
    ls.append((x, y))
res = [[0 for i in range(n)] for j in range(n)]
ct = Counter()
for i in range(n - 1):
    for j in range(i+1, n):
        res[i][j] = (ls[j][0] - ls[i][0], ls[j][1] - ls[i][1])
        res[j][i] = (- ls[j][0] + ls[i][0], - ls[j][1] + ls[i][1])
    ct.update(res[i])
ct.pop(0)
print(n - max(ct.values()))

### FIXED CODE ###

import sys
from collections import Counter
n = int(input())
ls = []
if n == 1:
    print(1)
else:
    for i in range(n):
        x, y = [int(i) for i in sys.stdin.readline().split()]
        ls.append((x, y))
    res = []
    for i in range(n - 1):
        for j in range(i+1, n):
            res.append((ls[j][0] - ls[i][0], ls[j][1] - ls[i][1]))
            res.append((- ls[j][0] + ls[i][0], - ls[j][1] + ls[i][1]))
    ct = Counter(res)
    print(n - max(ct.values()))
from bisect import bisect_right, bisect_left

N,K = map(int,input().split())
A = sorted(map(int,input().split()))

t0 = bisect_left(A,0)
t1 = bisect_right(A,0)
pos = A[t1:]
neg = [-v for v in reversed(A[:t0])]
zeros = t1-t0
offset_negative = len(pos)*len(neg)
offset_zero = zeros*(N-zeros) + zeros*(zeros-1)//2
offset = offset_zero + offset_negative

def bisect2(ng, ok, judge):
    while abs(ng-ok) > 1:
        m = (ng+ok)//2
        if judge(m):
            ok = m
        else:
            ng = m
    return ok

def count1(l,n):
    j = len(l)
    cnt = 0
    for i,a in enumerate(l):
        v = n//a
        while j > i and l[j-1] > v:
            j -= 1
        if j <= i:
            break
        else:
            cnt += j-i-1
    return cnt

def count2(l1,l2,n):
    j = len(l2)
    cnt = 0
    for i,a in enumerate(l1):
        v = n//a
        while j > 0 and l2[j-1] > v:
            j -= 1
        cnt += j
    return cnt


def cnt(n):
    if n > 0:
        cnt = count1(pos,n-1) + count1(neg,n-1) + offset
    else:
        cnt = offset_negative - count2(pos,neg,-n)
    return cnt


if offset_negative < K <= offset:
    print(0)
else:
    temp = max(pos[-1],neg[-1])**2
    print(bisect2(temp, -temp, lambda n: cnt(n) <= K-1))

# from itertools import combinations
# s = sorted(a*b for a,b in combinations(A,2))
# for i,v in enumerate(s):
#     print(cnt(v),i,v)

### FIXED CODE ###

from bisect import bisect_right, bisect_left

N,K = map(int,input().split())
A = sorted(map(int,input().split()))

t0 = bisect_left(A,0)
t1 = bisect_right(A,0)
pos = A[t1:]
neg = [-v for v in reversed(A[:t0])]
zeros = t1-t0
offset_negative = len(pos)*len(neg)
offset_zero = zeros*(N-zeros) + zeros*(zeros-1)//2
offset = offset_zero + offset_negative

def bisect2(ng, ok, judge):
    while abs(ng-ok) > 1:
        m = (ng+ok)//2
        if judge(m):
            ok = m
        else:
            ng = m
    return ok

def count1(l,n):
    j = len(l)
    cnt = 0
    for i,a in enumerate(l):
        v = n//a
        while j > i and l[j-1] > v:
            j -= 1
        if j <= i:
            break
        else:
            cnt += j-i-1
    return cnt

def count2(l1,l2,n):
    j = len(l2)
    cnt = 0
    for i,a in enumerate(l1):
        v = n//a
        while j > 0 and l2[j-1] > v:
            j -= 1
        cnt += j
    return cnt


def cnt(n):
    if n > 0:
        cnt = count1(pos,n-1) + count1(neg,n-1) + offset
    else:
        cnt = offset_negative - count2(pos,neg,-n)
    return cnt


if offset_negative < K <= offset:
    print(0)
else:
    temp = max(abs(a) for a in A)**2
    print(bisect2(temp, -temp, lambda n: cnt(n) <= K-1))

# from itertools import combinations
# s = sorted(a*b for a,b in combinations(A,2))
# for i,v in enumerate(s):
#     print(cnt(v),i,v)
X, N = map(int, input().split())
P = list(map(int, input().split()))

A = [0]*101
for i in P:
    A[i] = 1

if A[X] == 0:
    print(X)
    exit()

count = 1
while(1):
    if A[X - count] == 0:
        print(X - count)
        exit()

    if count > 0:
        count = -count
    else:
        count = -count
        count += 1

### FIXED CODE ###

X, N = map(int, input().split())
P = list(map(int, input().split()))

A = [0]*101

for i in P:
    A[i] = 1

if A[X] == 0:
    print(X)
    exit()

count = 1
while(1):
    if (X - count) >= 0:
        if (X - count) < 101:
            if A[X - count] == 0:
                print(X - count)
                exit()
        else:
            print(101)
            exit()

    if count > 0:
        count = -count
    else:
        count = -count
        count += 1