Harryxun/stf_run huggingface dataset:
N=input[]
A=input[]
print(N**2-A)

### FIXED CODE ###

N=int(input())
A=int(input())
print(N**2-A)
import sys
N,i = map(int,input().split())
array = [ x for x in range(N) ]
if not ( 1 <= N <= 100 and 1 <= i <= N ):
    sys.exit()

for I in range(N):
    if array[i] == array[-I]:
        print(I+1)

### FIXED CODE ###

import sys
N,i = map(int,input().split())
if not ( 1 <= N <= 100 and 1 <= i <= N ):
    sys.exit()

print(N - i + 1)
N,M,K=map(int,input().split())
ret = 'No'
for m in range(M+1):
  a=K-m*N
  b=M-2*m
  if 0<=a and 0<=b and a%b==0:
    n=a//b
    if 0<=n<=N:
      ret = 'Yes'
print(ret)

### FIXED CODE ###

N,M,K=map(int,input().split())
ret = 'No'
for m in range(M+1):
  a=K-m*N
  b=M-2*m
  if 0<=a and 0<b and a%b==0:
    n=a//b
    if 0<=n<=N:
      ret = 'Yes'
print(ret)
x, y, z = input().split(" ")
print(f"{z} {x} {y}")

### FIXED CODE ###

x, y, z = input().split(" ")
print("{} {} {}".format(z,x,y))
str = input()
s_head = str[0]
s_tail = str[1]
s_middle = len(str) -2
ans = s_head + str(s_middle) + s_tail

### FIXED CODE ###

s = input()
print(s[0] + str(len(s) -2) + s[-1])
A,B = map(int,input().split(' '))
if A > B:
  print('GREATER')
elif B > A:
  print('LESS')
else:
  print('EQUAL')

### FIXED CODE ###

A = int(input())
B = int(input())
if A > B:
  print('GREATER')
elif B > A:
  print('LESS')
else:
  print('EQUAL')
X=int(input())
if X==1:
  print(1)
if X==2:
  print(2)
for i in range(2,X):
  if i*i+i>=2*X:
    ans=i
    break
  print(ans)

### FIXED CODE ###

x=int(input())
for i in range(1,10**5):
    if x<=(i*(i+1))//2:
        print(i)
        break
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)



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

MOD = 10**9+7
lcm_val = lcm_list(A)
diff = [lcm_val // a for a in A]
print(sum(diff)%MOD)


### FIXED CODE ###

class PrimeOptimizer:
    def __init__(self, MAX_NUM=10**3):
        is_prime = [True] * MAX_NUM
        is_prime[0] = False
        is_prime[1] = False
        primes = []
        for i in range(MAX_NUM):
            if is_prime[i]:
                primes.append(i)
                for j in range(2*i, MAX_NUM, i):
                    is_prime[j] = False
        self.primes = primes

    def prime_factorization(self, x):
        res = {}
        for prime in self.primes:
            while x % prime == 0:
                if not prime in res:
                    res[prime] = 0
                res[prime] += 1
                x //= prime
        if x > 1:
            res[x] = 1
        return res

MOD = 10**9+7

def mod_pow(p, q):
    res = 1
    while q:
        if q & 1:
            res = (res * p) % MOD
        p = (p * p) % MOD
        q //= 2
    return res

def mod_inv(p):
    return mod_pow(p, MOD - 2)

def solve(n, a):
    primeOpt = PrimeOptimizer()
    D = {}
    for i in range(n):
        prime_num_mapping = primeOpt.prime_factorization(a[i])
        for prime, num in prime_num_mapping.items():
            if not prime in D:
                D[prime] = 0
            D[prime] = max(D[prime], num)
    L = 1
    for prime, num in D.items():
        L = (L * mod_pow(prime, num)) % MOD
    res = sum([L * mod_inv(x) % MOD for x in a])
    return res % MOD

N = int(input())
A = list(map(int, input().split()))
print(solve(N, A))
s=input()
print(s.replace("\,"," ")

### FIXED CODE ###

s=input()
print(s.replace(","," "))
N,K = map(int,input().split())
H = list(map(int,input().split()))
H = sorted(H)[::-1]
for i in range(K):
  del H[0]
print(str(sum(H)))


### FIXED CODE ###

N,K = map(int,input().split())
H = list(map(int,input().split()))
H = sorted(H)[::-1]
del H [0:K]
print(str(sum(H)))
if __name__ == "__main__":
    N = int(input())
    S = input()

    dp = [[0] * 5001 for i in range(5001)]

    for i in range(N, 0, -1):
        for j in range(N, 0, -1):
            if S[i-1] != S[j-1]:
                dp[i][j] = 0
            else:
                dp[i][j] = dp[i+1][j+1] + 1

    result = 0
    for i in range(N):
        for j in range(N):
            if i >= j:
                continue
            now = min(dp[i][j], j-i)
            result = max([now, result])

    print(result)


### FIXED CODE ###

if __name__ == "__main__":
    N = int(input())
    S = input()

    dp = [[0] * 5005 for i in range(5005)]

    for i in range(N, 0, -1):
        for j in range(N, 0, -1):
            if S[i-1] != S[j-1]:
                dp[i][j] = 0
            else:
                dp[i][j] = dp[i+1][j+1] + 1

    result = 0
    for i in range(N):
        for j in range(N):
            if i >= j:
                continue
            now = min(dp[i][j], j-i)
            result = max([now, result])

    print(result)
import sys
sys.setrecursionlimit(4000000000000)
def knap(n,w,weight,value,dp):
  #  print(n,":",w,":",len(dp),":",len(dp[n]))
    if dp[n][w]!=-1:
        return dp[n][w]
    if n==0:
        dp[n][w]=0
        return 0
    if w==0:
        dp[n][w]=0
        return 0
    if w-weight[n]<0:
        tmp2=knap(n-1,w,weight,value,dp)
        dp[n][w]=tmp2
        return tmp2
    tmp1=knap(n-1,w-weight[n],weight,value,dp)+value[n]
    tmp2=knap(n-1,w,weight,value,dp)
    if tmp1>tmp2:
        dp[n][w]=tmp1
        return tmp1
    else:
        dp[n][w]=tmp2
        return tmp2
        

n,W=map(int,input().split())
weight=[0]
value=[0]
for i in range(n):
    a,b=map(int,input().split())
    weight.append(a)
    value.append(b)
dp=[[-1]*(W+1)]*(n+1)
print(knap(n,W,weight,value,dp))



### FIXED CODE ###

N,W=map(int,input().split())
w=[]
v=[]
maxV=0
for i in range(N):
    a,b=map(int,input().split())
    if maxV<b:
        maxV=b
    w.append(a)
    v.append(b)
#dp[n個目のアイテムまでで][V以上を達成する]=最小のw
#dp[0][v]=inf ゼロ個でｖは無理なので
#dp[0][0]=0と初期化する
#だからiの時dp[i][v]=min(dp[i-1][v],dp[i-1][V-v[i-1]]+w[i])である<-i-1なのはvとかにはゼロ個とかないので
#V-v[i]<0ならば、とれないので前者になるね！！
#これをi=0(は初期化でする)->nまでおこない、各iについてはとりうる最大のValueを考えるが
#これは最大で各アイテムについて最大のVがあってこれにアイテム数Nを掛けたものである
#つまりdpのサイズはdp[0->N][0->maxV*N]をとればよい

dp=[[float("inf") for i in range(maxV*(N+1))] for j in range(N+1)]
dp[0][0]=0

for i in range(1,N+1):
    for val in range(maxV*N+1):
        tmp1=dp[i-1][val]#とらない
        if val-v[i-1]<0:#この時、iこめの価値がおおきいので、これをとるだけで達成してしまう
            tmp2=w[i-1]#i=1の時、dp[0][val]=inf
        else:#i=1の時val-v[0]>0で無限になるので
            tmp2=dp[i-1][val-v[i-1]]+w[i-1]#
        res=min(tmp1,tmp2)
        dp[i][val]=res
#ここでW以下となるvalの最大値をたんさくする
max=0
for value in range(len(dp[N])):
    if dp[N][value]<=W:
        if value>max:
            max=value
print(max)
import numpy as np


def main():
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    dp = np.zeros((single + 3, double + 3, triple + 3))
    for k in range(triple+2):
        for j in range(double+2):
            for i in range(single + 2):
                if i == 0 and j == 0 and k == 0:
                    continue
                first = second = third = 0
                if i-1 >= 0 and j >= 0 and k >= 0:
                    first = dp[i - 1][j][k]
                if i+1 >= 0 and j-1 >= 0 and k >= 0:
                    second = dp[i + 1][j - 1][k]
                if i >= 0 and j+1 >= 0 and k-1 >= 0:
                    third = dp[i][j + 1][k - 1]
                dp[i][j][k] = (first*i + second * j +
                               third * k + N) / (i + j + k)
    print(dp[single][double][triple])


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    dp = [[[0 for i in range(1+single+double+triple-j-k)]
           for j in range(double + triple + 1 - k)] for k in range(triple + 1)]
    for k in range(triple+1):
        for j in range(double + triple + 1-k):
            for i in range(1+single+double+triple-j-k):
                if i == 0 and j == 0 and k == 0:
                    continue
                first = second = third = 0
                if i-1 >= 0 and j >= 0 and k >= 0:
                    first = dp[k][j][i-1]
                if i+1 >= 0 and j-1 >= 0 and k >= 0:
                    second = dp[k][j - 1][i+1]
                if i >= 0 and j+1 >= 0 and k-1 >= 0:
                    third = dp[k-1][j + 1][i]
                dp[k][j][i] = (first*i + second * j +
                               third * k + N) / (i + j + k)
    print(dp[triple][double][single])


if __name__ == "__main__":
    main()
import copy
x,y = list(map(int, input().split()))
Z = [list(map(int, input().split())) for _ in range(x)]

def gonext(a,b):
    if a < x-1:
        a += 1
    else:
        b += 1
        a = 0
    return(a,b)

a, b = 0, 0
ans = []
count = 0
while a < x and b < y:
    now = Z[a][b]
    a_copy= copy.deepcopy(a)
    b_copy = copy.deepcopy(b)
    a, b = gonext(a, b)
    if now % 2 == 1:
        Z[a][b] += 1
        ans.append([a_copy, b_copy, a, b])
        count += 1

print(count)
for i in ans:
    k = [j+1 for j in i]
    print(" ".join(list(map(str, k))))

### FIXED CODE ###


import copy
y,x = list(map(int, input().split()))
Z = [list(map(int, input().split())) for _ in range(y)]

way = 1
a, b = 0, 0
ans = []
count = 0
while a < y and b < x:
    now = Z[a][b]
    a_copy= copy.deepcopy(a)
    b_copy = copy.deepcopy(b)

    if (way == 1 and a < y-1) or (way == -1 and a > 0):
        a += way
    else:
        b += 1
        way = way*(-1)
    if not (a < y and b < x):
        break
    if now % 2 == 1:
        Z[a][b] += 1
        ans.append([a_copy, b_copy, a, b])
        count += 1

print(count)
for i in ans:
    k = [j+1 for j in i]
    print(" ".join(list(map(str, k))))
N, M = input().split()
K = []
P = []
adjacent = [[0] for i in range(M)]
for i in range(M):
  A = list(input())
  K[i] = A[0]
  adjacent[i] = A[1:]
P = list(input())
X = 0
a = [[0] for i in range(M)]
for i in range(2**N):
  b = []
  for j in range(N):
    if i%2 == 1:
      b.append(j)
    i = i//2
  for j in range(M):
    if len(set(b)&set(adjacent[j]))%2 == P[j]:
      a[j] = 1
  if sum(a) == M:
    X += 1
print(X)
    

### FIXED CODE ###

N, M = map(int, input().split())
K = [[0] for i in range(M)]
adjacent = [[0]*N for i in range(M)]
for i in range(M):
    A = list(input().split())
    K[i] = A[0]
    for j in A[1:]:
        adjacent[i][int(j)-1] = 1
P = list(input().split())
X = 0
for i in range(2**N):
  a = 0
  b = [0]*N
  for j in range(N):
    if i%2 == 1:
      b[j] = 1
    i = i//2
  for j in range(M):
    if  sum([x*y for (x,y) in zip(b, adjacent[j])])%2 == int(P[j]):
      a += 1
  if a == M:
    X += 1
print(X)
n = int(input())
2.b = list(map(int,input().split()))
3.b.sort()
4.     
5.d = b[0] + 0
6. 
7.while len(b) > 1 :
8.    for i in range(1,len(b)) :
9.        b[i] = b[i] % b[0]
10.    if b.count(0) == len(b)-1 :
11.        d = b[0]
12.        break
13.    else :
14.        b.sort()
15.        for j in range(b.count(0)) :
16.            b.remove(0)
17.print(d)


### FIXED CODE ###

from sys import stdin
from functools import reduce
import fractions
#input = stdin.readline
N = int(input())
A = list(set(map(int,input().split())))
answer = reduce(fractions.gcd, A)
print(answer)
s=list(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
d=list(set(s))
d.sort()
ans="None"
for i in range(max(len(a),len(d))):
    if d[i]!=a[i]:
        ans=a[i]
        break
print(ans)

### FIXED CODE ###

s=list(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
d=list(set(s))
d.sort()
ans="None"
for i in range(min(len(a),len(d))):
    if d[i]!=a[i]:
        ans=a[i]
        break
    u=i
if len(d)<len(a) and ans=="None":
    ans=a[u+1]
print(ans)
# -*- coding: utf-8 -*-

# initialize
N,K = map(int, input().split())
list = [0] * 10**5

# In:list, Out:ans
def solve(k,l):
    for i in range(len(l)):
        k -= l[i]
        if (k <= 0):
            return i
    return 0

# Input a and b to the list
for i in range(N):
    a,b = map(int, input().split())
    list[a] += b

print(str(solve(K,list)))


### FIXED CODE ###

# -*- coding: utf-8 -*-

def Judge(a, b, c):
    if a > c:
        return 'No'
    elif c > b:
        return 'No'
    else:
        return 'Yes'

a,b,c = map(int, input().split())
print(Judge(a,b,c))
import numpy as np
import pandas as pd

X, Y, Z = map(int, input().split())
print(Z, X, Y)


### FIXED CODE ###

X, Y, Z = map(int, input().split())
print(Z, X, Y)
N = int(input())
A = list(map(int, input().split()))
col = [0] * 9
for i in A:
  col[i // 400] += 1

ans = 0
for i in col[:8]:
  if i > 0:
    ans += 1

print(ans, ans + col[-1])

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
col = [0] * 9
for i in A:
  r = i//400
  if r > 8:
    r = 8
  col[r] += 1

ans = 0
for i in col[:8]:
  if i > 0:
    ans += 1

if ans == 0:
  print(1, col[-1])
else:
  print(ans, ans + col[-1])
import math
r = int(input())
print(math.pi * (r ** 2), 2 * math.pi * r)


### FIXED CODE ###

import math
r = float(input())
print(math.pi * (r ** 2), 2 * math.pi * r)
N = int(input())
T, A = map(int, input().split())
dif = list(map(lambda x: abs(T - int(x) * 0.006 - A), input().split()))
print(dif.index(min(x_list)) + 1)

### FIXED CODE ###

N = int(input())
T, A = map(int, input().split())
dif = list(map(lambda x: abs(T - int(x) * 0.006 - A), input().split()))
print(dif.index(min(dif)) + 1)
import math
from scipy.special import comb

#def permod(n, r):
  #return (math.factorial(n) // math.factorial(n - r)) % (10 ** 9 + 7)

from operator import mul
from functools import reduce

def com(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def main():
  X,Y = map(int,input().split())
  
  if (X + Y) % 3 != 0:
    print(0)
    
  else:
    a = Y - (X + Y) // 3
    b = X - (X + Y) // 3
    
    ans = com(a + b,b)
    
    print(ans)
    
main()

### FIXED CODE ###

def cmb(n, k, mod, fac, infac):
  k = min(k,n-k)
  return fac[n] * infac[k] * infac[n-k] % mod

def tables(mod, n):
  fac = [1, 1] 
  infac = [1, 1] 
  inverse = [0, 1] 
  for i in range(2, n+1):
    fac.append((fac[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    infac.append((infac[-1] * inverse[-1]) % mod)
  return fac,infac

X,Y = map(int, input().split())

if X > Y:
  X, Y = Y, X

move = X + Y

if move % 3 != 0:
  print(0)
else:
  total = move // 3
  n = X - total
  
  if n < 0:
    print(0)
    
  else:
    MOD = 10 ** 9 + 7
    fac, infac = tables(MOD, total)
    ans = cmb(total, n, MOD, fac, infac)
    
    print(ans)
val = 0
for s in list(input()):
  if(s == '+'):
    val++
  else:
    val--
print(val)

### FIXED CODE ###

val = 0
for s in list(input()):
  if(s == "+"):
    val+=1
  else:
    val-=1
print(val)
n, k = map(int, input().split())
lst = list(map(int, input().split()))
sortlst = sorted(lst, key = abs, reverse = True)
#print(sortlst)

signlst = ["posi" if sortlst[i] >= 0 else "nega" for i in range(n)] 
#print(signlst)

if "nega" not in signlst:
#	print("posi only")
	ans = 1
	for j in range(k):
		ans *= sortlst[j] 

elif "posi" not in signlst:
#	print("only nega")
	ans = 1
	if k % 2 == 0:
#		print("nega even")
		for l in range(k):
			ans *= sortlst[l]
		
	else:
#		print("nega odd")
		resortlst = sorted(lst, key = abs, reverse = False)
#		print(resortlst)
		ans = 1
		for m in range(k):
			ans *= resortlst[m]

else:
#	print("mix")
	ans = 0
	seki = 1
	for o in range(k):
		seki *= sortlst[o]

	if seki >= 0:
		ans = seki
		
	else:
		if "posi" not in signlst[k : n] and "nega" not in signlst[k : n]:
			ans = seki
			
		else:
			sortlst2 = sorted(sortlst[:k], reverse = True)
			minposi_index = max([i for i in range(k) if sortlst2[i] >= 0])
			kouho1 = seki / sortlst2[minposi_index + 1] * max(sortlst[k : n])
			kouho2 = seki / sortlst2[minposi_index] * min(sortlst[k : n])
			if "nega" not in signlst[k : n]:
				ans = kouho1
				
			elif "posi" not in signlst[k : n]:
				ans = kouho2
				
			else:
				ans = max(kouho1, kouho2)

#print(ans)
print(ans % (10 ** 9 + 7))


### FIXED CODE ###

n,k=map(int,input().split())
A=sorted(list(map(int,input().split())))


mod=10**9+7

if A[-1]<0 and k%2==1:
    now=1
    for i in range(k):
        now*=A[-i-1]%mod
        now%=mod
    print(now) ;exit()

l=0 ; r=n-1
ans=1
if k%2==1:
    ans=A[-1]
    r-=1

for i in range(k//2):
    mi=A[l]*A[l+1]
    pl=A[r]*A[r-1]
    if mi>pl:
        ans*= mi%mod
        ans%=mod
        l+=2
    else:
        ans*= pl%mod
        ans%=mod
        r-=2
print(ans%mod)
S, T = [str(i) for i in input().split()]
 
s = list(S)
t = list(T)
s_n = len(s)
t_n = len(t)
n = 0
n = s_n - t_n + 1
min = t_n
 
for a in range(n):
  count = 0 
	for b in range(t_n):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
      
print(min)

### FIXED CODE ###

x = [input() for i in range(2)]
S = x[0]
T = x[1]
moji = len(T)

for a in range(len(S) - len(T) + 1):
  count = 0
  for b in range(len(T)):
    
    if S[a+b] != T[b]:
      count += 1
  if count < moji:
    moji = count

print(moji)
n, m = input().split()
days = list(map(int, input().split()))
print(n - sum(days))

### FIXED CODE ###

n, m = input().split()
days = list(map(int, input().split()))
if int(n) < sum(days):
  print("-1")
else:
  print(int(n) - sum(days))
N,M,C=map(int.input().split())
B=list(map(int.input().split()))
ans = 0
for i in range(N):
  A = list(map(int.input().split()))
  tmp = C
  for j in range(M):
    tmp += A[j]*B[j]
  if tmp > 0:
    ans += 1
print(ans)


### FIXED CODE ###

N,M,C=map(int,input().split())
B=list(map(int,input().split()))
ans = 0
for i in range(N):
  A = list(map(int,input().split()))
  tmp = C
  for j in range(M):
    tmp += A[j]*B[j]
  if tmp > 0:
    ans += 1
print(ans)
import math

n = int(input())

t = int(math.sqrt(n))

ans = 0

for i in reversed(range(t)):
    if n % i == 0:
        ans = n//i+i
        break
        
print(ans-2)

### FIXED CODE ###

import math

n = int(input())

t = int(math.sqrt(n))

ans = 0

for i in reversed(range(t+1)):
    if n % i == 0:
        ans = n//i+i
        break
        
print(ans-2)
import math

while True:
    try:
        r = int(input())

        A = [i for i in range(2, r+1)]
        P = []
        time = 0

        while True:
            prime = min(A)

            if prime > math.sqrt(r):
                break

            P.append(prime)

            i = 0
            while i < len(A):
                if A[i] % prime == 0:
                    A.pop(i)
                    continue
                i += 1
        for a in A:
            P.append(a)

        print(len(P))

    except EOFError:
        break



### FIXED CODE ###

LIMIT = 10000000
  
isPrime = [True for _ in range(LIMIT)]
 
isPrime[0] = isPrime[1] = False
  
for i in range(2, int(LIMIT ** 0.5)+1):
  if isPrime[i]:
    for j in range(i * i, LIMIT, i):
      isPrime[j] = False
  
try:
    while True:
        n = int(input())
 
        count = 0
        if n >= 2:
            count = 1
 
        for i in range(3, n+1, 2):
            if isPrime[i]:
                count += 1
 
        print(count)
except EOFError:
  pass
n = input()
if n % 4 ==0 or n % 7 ==0:
    print('Yes')
    exit()
for i in range(n // 4 + 1):
    for j in range (n // + 1):
        if 4 * i + 7 * == n:
            print('Yes')
            exit()
print('No')

### FIXED CODE ###

n = int(input())
if n % 4 ==0 or n % 7 ==0:
    print('Yes')
    exit()
for i in range(n // 4 + 1):
    for j in range (n // + 1):
        if 4 * i + 7 * j == n:
            print('Yes')
            exit()
print('No')
from collections import Counter, deque

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

MOD = 10 ** 9 + 7

c = Counter()
for a in A:
    if a == 0:
        c['0'] += 1
    elif a < 0:
        c['-'] += 1
    else:
        c['+'] += 1

if c['-'] + c['+'] < K:
    print(0)
elif (c['-'] == N and K % 2 == 1) or (N == K and c['-'] % 2 == 1):
    def f(x):
        if x == 0:
            return 10 ** 9
        else:
            return abs(x)


    A = sorted(A, key=f)
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
else:
    A = sorted(A, key=lambda x: abs(x), reverse=True)
    plus = deque()
    minus = deque()

    for i in range(K):
        if A[i] >= 0:
            plus.append(A[i])
        else:
            minus.append(A[i])

    if len(minus) % 2 == 1:
        p = None
        m = None
        for i in range(K, N):
            if A[i] >= 0 and p is None:
                p = A[i]
            if A[i] < 0 and m is None:
                m = A[i]
            if p is not None and m is not None:
                break
        if minus[-1] * m > plus[-1] * p:
            plus.pop()
            minus.append(m)
        else:
            minus.pop()
            plus.append(p)

    ans = 1
    while plus:
        ans *= plus.popleft()
        ans %= MOD
    while minus:
        ans *= minus.popleft()
        ans %= MOD

    print(ans)


### FIXED CODE ###

from collections import Counter, deque

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

MOD = 10 ** 9 + 7

n_minus = 0
for a in A:
    if a < 0:
        n_minus += 1
if N == K:
    ans = 1
    for a in A:
        ans *= a
        ans %= MOD
    print(ans)
elif n_minus == N and K % 2 == 1:
    def f(x):
        if x == 0:
            return 10 ** 9
        else:
            return abs(x)


    A = sorted(A, key=f)
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD

    print(ans)
else:
    A = sorted(A, key=lambda x: abs(x), reverse=True)
    plus = deque()
    minus = deque()

    for i in range(K):
        if A[i] >= 0:
            plus.append(A[i])
        else:
            minus.append(A[i])

    if len(minus) % 2 == 1:
        if len(plus) == 0:
            minus.pop()
            for a in A[K:]:
                if a >= 0:
                    plus.append(a)
                    break
        else:
            p = None
            m = None
            for a in A[K:]:
                if a >= 0 and p is None:
                    p = a
                if a < 0 and m is None:
                    m = a
                if p is not None and m is not None:
                    break

            if m is None:
                minus.pop()
                plus.append(p)
            elif p is None:
                plus.pop()
                minus.append(m)
            elif minus[-1] * m > plus[-1] * p:
                plus.pop()
                minus.append(m)
            else:
                minus.pop()
                plus.append(p)

    ans = 1
    while plus:
        ans *= plus.popleft()
        ans %= MOD
    while minus:
        ans *= minus.popleft()
        ans %= MOD

    print(ans)
S = sorted(list(input()))
if S[1]==S[2] and S[3]==S[4] and len(S[1])==2
print
	("YES")
else
  	print("NO")

### FIXED CODE ###

print("Yes" if len(set(input()))==2 else "No")