Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

# coding=utf-8

if __name__ == '__main__':
    N = int(input())
    li_A = list(map(int, input().split()))

    ans = li_A[0]

    for i in range(1,N):
        if (ans * li_A[i]) <= 1000000000000000000:
            ans = ans * li_A[i]

        else:
            ans = -1

    print(ans)

### FIXED CODE ###

# coding=utf-8
import sys

if __name__ == '__main__':
    N = int(input())
    li_A = list(map(int, input().split()))

    ans = li_A[0]

    if 0 in li_A:
        print('0')
        sys.exit()

    for i in range(1, N):
        if ans * li_A[i] > 1000000000000000000:
            print('-1')
            sys.exit()
        else:
            ans *= li_A[i]

    print(ans)
### BUGGY CODE ###


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

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

dic = {}

for i in A:

    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1

lis = []

for i in dic:

    lis.append(dic[i])

lis.sort()

ans = 0

cnt = 0
while len(lis) > K:

    ans += lis[0]
    del lis[0]

    cnt += 1
    if cnt > 200000:
        break

print (ans)


### FIXED CODE ###


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

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

dic = {}

for i in A:

    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1

lis = []

for i in dic:

    lis.append(dic[i])

lis.sort()

ans = 0

num = len(lis) - K
if num < 0:
    num = 0

for i in range(num):
    ans += lis[i]

print (ans)
### BUGGY CODE ###

buffer = list(input())
S = list(map(int, buffer))
N = len(S)
i = 0
count = 0
while(1):
    if(S == [] or N == 1):
        break
    elif((S[i] + S[i + 1]) == 1):
        S.pop(i)
        S.pop(i)
        i = 0
        count += 2
        N = len(S)
    else:
        i += 1
        if(i == (N - 1)):
            break
print(count)

### FIXED CODE ###

S = list(input())
count_bule = S.count('0')
count_red = S.count('1')
count_min = min(count_bule, count_red)
print(2 * count_min)
### BUGGY CODE ###

N = int(input())
alist = list(map(str, input().split()))
for i in range(1,N+1):
  print(alist.count(str(i)))

### FIXED CODE ###

from collections import Counter

N = int(input())
a = list(map(int, input().split()))
c = Counter(a)
for i in range(1,N+1):
  print(c[i])
### BUGGY CODE ###

while 1:
    r, c = map(int, raw_input().split())
    if r == 0: break
    old = [None for i in range(r)]
    new = [[True]*c for i in range(r)]
    for i in range(r):
        old[i] = "".join(map(str, raw_input().split()))
    ans = 0
    n = 1<<r
    for i in range(n):
        for j in range(r):
            if i & (1<<j):
                for k in range(c):
                    new[j][k] = bool(int(old[j][k])) ^ True
            else:
                for k in range(c):
                    new[j][k] = bool(int(old[j][k]))
        ret = 0
        for j in range(c):
            cnt = 0
            for k in range(r):
                if not new[k][j]: cnt+=1
            ret += cnt if cnt > r/2 else r-cnt
        ans = max(ans, ret)
    print ans

### FIXED CODE ###

while 1:
    r, c = map(int, raw_input().split())
    if r == 0: break
    old = [raw_input().split() for i in range(r)]
    old = map(list, zip(*old))
    new = [int("".join(lst),2) for lst in old]
    ans = 0
    for i in range(1<<r):
        ret = 0
        for j in new:
            cnt = bin(i^j).count('1')
            ret += cnt if cnt > r/2 else r-cnt
        ans = max(ans, ret)
    print ans
### BUGGY CODE ###

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

max_num = 0
count = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        if max_num < A[j] - A[i]:
            max_num = A[j] - A[i]
            count = 1
            continue

        if max_num == A[j] - A[i]:
            count += 1

print(count)


### FIXED CODE ###

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

min_num = 10 ** 9 + 7
diff = 0
count = 0
for i in range(N):
    min_num = min(min_num, A[i])
    if diff == A[i] - min_num:
        count += 1
    elif A[i] - min_num > diff:
        count = 1
        diff = A[i] - min_num
    else:
        continue

print(count)
### BUGGY CODE ###

n = int(input())
lis = list(map(int, input().split()))
a = list(range(1, n+1))
print(*[1+lis.index(i) for i in a])


### FIXED CODE ###

n = int(input())
lis = list(map(int, input().split()))
a = [0]*n

for i, item in enumerate(lis):
    a[item - 1] = i + 1

print(*a)
### BUGGY CODE ###

N, K = [int(e) for e in input().split()]
xyc = [input().split() for i in range(N)]
xyc = [(int(x), int(y), c == "W") for x, y, c in xyc]

def calc0(K, xyc):
    rmax = 0
    for i in range(K * 2):
        for j in range(K * 2):
            rcount = 0
            for x, y, c in xyc:
                rcount += ((x + j) // K + (y + i) // K) % 2 == c
            rmax = max(rmax, rcount)
    return rmax

def calc1(K, xyc):
    rmax = 0
    for i in range(K * 2):
        xs = [(x + c * K + (y + i) // K * K) % (2 * K) for x, y, c in xyc]
        for j in range(K * 2):
            rcount = 0
            for x in xs:
                rcount += ((x + j) // K)  % 2 == 1
            rmax = max(rmax, rcount)
    return rmax

def calc(K, xyc):
    rmax = 0
    for i in range(K):
        xs = [(x + c * K + (y + i) // K * K) % (2 * K) for x, y, c in xyc]
        ts = [0 for x in range(K * 4)]
        for x in xs:
            ts[x] += 1
            ts[x + K * 2] += 1
        rcount = sum(ts[0:K])
        for j in range(K):
            rcount += -ts[j] + ts[j+K]
            rmax = max(rmax, rcount, N - rcount)
    return rmax

#import random
#N = 10000
#K = 1000
#xyc = [(random.randint(0, 10000), random.randint(0, 10000), random.randint(0, 10000) % 2) for i in range(N)]

#print(calc0(K, xyc))
#print(calc1(K, xyc))
print(calc(K, xyc))



### FIXED CODE ###

def calc(K, xyc):
    K2 = K * 2
    N = len(xyc)

    p = [[0] * K2 for i in range(K2)]
    for x, y, c in xyc:
        y += c * K
        p[x % K2][y % K2] += 1
        p[(x + K) % K2][(y + K) % K2] += 1

    def isum(xs):
        r = 0
        yield r
        for x in xs:
            r += x
            yield r

    psum = [list(isum(row)) for row in p]
    pksum = [[b - a for a, b in zip(row, row[K:])] for row in psum]

    rmax = N / 2
    for y in range(K):
        rcount = sum(row[y] for row in pksum[:K])
        for x in range(K):
            rmax = max(rmax, rcount, N - rcount)
            rcount += -pksum[x][y] + pksum[x + K][y]

    return rmax

if __name__ == '__main__':
    N, K = [int(e) for e in input().split()]
    xyc = [(int(x), int(y), c == "W") for x, y, c in [input().split() for i in range(N)]]
    print(calc(K, xyc))
### BUGGY CODE ###

A,B,K = map(int,input().split())
ans = []
for i in range(A,B+1):
    if i <= K+A-1 or i >= B-K+1:
        ans.append(i)
ans.sort()
for i in range(len(ans)):
    print(ans[i])

### FIXED CODE ###

A,B,K = map(int,input().split())
ans = []
for i in range(A,K+A):
    if i > B:
        break
    ans.append(i)

for i in range(B-K+1,B+1):
    if i < A:
        continue
    ans.append(i)

ans = set(ans)
ans = list(ans)
ans.sort()
for i in range(len(ans)):
    print(ans[i])
### BUGGY CODE ###

n = int(input())

l1 = 0
for i in range(n // 2):
  if n % (i +1) == 0 and l1 == 0:
    l1 = (n // (i + 1) + i - 1)
  elif n % (i +1) == 0 and (n // (i + 1) + i - 1) < l1:
    l1 = (n // (i + 1) + i - 1)
print(l1)

### FIXED CODE ###

n = int(input())
 
l1 = []
for i in range(1, int(n ** 0.5) + 1):
  q, mod = divmod(n , i)
  if mod == 0:
    l1.append(q + i -2)
print(min(l1))
### BUGGY CODE ###

n = int(input())
b = [int(x) for x in input().split()]
r = 1
max = 10**18

for i in b:
  r *= i
  
r = -1 if r > max else r
print(r)

### FIXED CODE ###

n = int(input())
l = [int(x) for x in input().split()]

if 0 in l:
    r=0
else:
    r = 1
    for x in range(n):
        r = r * l[x]
        if r > 10**18:
            r=-1
            break
  
print(r)
### BUGGY CODE ###

N, M = map(int, input().split())
tmp = []
PY = [[] for _ in range(N + 1)]

for i in range(M):
    p, y = map(int, input().split())
    tmp.append([p, y])
    PY[p].append(y)

for i in range(1, N + 1):
    PY[i].sort()

for prefecture, year in tmp:
    text = ""
    text += "%06d" % prefecture
    text += "%06d" % (PY[prefecture].index(year) + 1)
    print(text)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
PY = [[] for _ in range(N + 1)]

for i in range(M):
    p, y = map(int, input().split())
    PY[p].append((y, i))

ans = []

for pre_id, info in enumerate(PY):
    info.sort()
    for i in range(len(info)):
        ans.append((info[i][1], "%06d" % pre_id, "%06d" % (i + 1)))

ans.sort()
for i, x, y in ans:
    print(str(x) + str(y))
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
import copy

def main():
	num = int(input())
	
	clocks = []
	for _ in range(num):
		clock = int(input())
		clocks.append(clock)
		
	times = copy.deepcopy(clocks)
	while True:
		max_num = max(times)
		for i, time in enumerate(times):
			if max_num == time : continue
			
			tmp = max_num // time
			times[i] = times[i] * tmp
			
		flg = True
		num = times[0]
		for time in times:
			if num != time:
				flg = False
				
		if flg:
			print(num)
			sys.exit()
		else:
			for i, time in enumerate(times):
				if max_num == time:
					times[i] = times[i] + clocks[i]
					max_num = times[i]
					break
			
if __name__ == "__main__":
	main()
	

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy

def main():
	num = int(input())
	
	clocks = []
	for _ in range(num):
		clock = int(input())
		clocks.append(clock)
		
	ans = 1
	for clock in clocks:
		ans = lcm(ans, clock)
	print(ans)
			
def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def lcm(a, b):
	g = gcd(a, b)
	return a // g * b
	
if __name__ == "__main__":
	main()
### BUGGY CODE ###

n,m = map(int,input().split())
l1,r1 = map(int,input().split())

dynamic_lst = list(range(l1,r1+1))
for _ in range(m-1):
    l,r = map(int,input().split())
    temp_lst = list(range(l,r+1))
    lst_wa = dynamic_lst + temp_lst
    new_lst = [i for i in set(lst_wa) if lst_wa.count(i) > 1]
    dynamic_lst = new_lst

print(len(dynamic_lst))

### FIXED CODE ###

n,m = map(int,input().split())
lst_l = []
lst_r = []
for _ in range(m):
    l,r = map(int,input().split())
    lst_l.append(l)
    lst_r.append(r)

max_l = max(lst_l)
min_r = min(lst_r)

count = 0
for i in range(n):
    if max_l <= i+1 <= min_r:
        count += 1

print(count)
### BUGGY CODE ###

import numpy as np

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

res = 1
i = 1

if N == 1:
    print(P)
    exit()

while True:
    t = np.power(i, N)

    if t > P:
        break
    if P % t == 0:
        res = i

    i += 1

print(res)


### FIXED CODE ###

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

if N == 1:
    print(P)
    exit()

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)
### BUGGY CODE ###

N, K = map(int, input().split())
A = [[0 for _ in range(N)] for _ in range(30)]
B = [0] * N
for i in range(N):
  a, b = map(int, input().split())
  for j in range(30):
    A[j][i] = a % 2
    a //= 2
  B[i] = b
M = [0] * 30
_M = [0] * N
_K = K
for i in range(30):
  k = _K % 2
  M[i] = k
  _K //= 2
  if k:
    continue
  for j in range(N):
    _M[j] += A[i][j]
cnt = 0
for i in range(N):
  if _M[i]:
    continue
  cnt += B[i]
Z = [0] * N
for i in range(30):
  if M[i] == 0:
    for j in range(N):
      Z[j] += A[i][j]
  else:
    _cnt = 0
    for j in range(N):
      _M[j] += A[i][j] - Z[j]
      Z[j] = A[i][j]
      if _M[j]:
        continue
      _cnt += B[j]
    cnt = max(_cnt, cnt)
print(cnt)

### FIXED CODE ###

N, K = map(int, input().split())
A = [[0 for _ in range(N)] for _ in range(30)]
B = [0] * N
for i in range(N):
  a, b = map(int, input().split())
  for j in range(30):
    A[j][i] = a % 2
    a //= 2
  B[i] = b
M = [0] * 30
_M = [0] * N
_K = K
for i in range(30):
  k = _K % 2
  M[i] = k
  _K //= 2
  if k:
    continue
  for j in range(N):
    _M[j] += A[i][j]
cnt = 0
for i in range(N):
  if _M[i]:
    continue
  cnt += B[i]
Z = [0] * N
for i in range(30):
  if M[i] == 0:
    for j in range(N):
      Z[j] += A[i][j]
  else:
    _cnt = 0
    for j in range(N):
      _M[j] += A[i][j] - Z[j]
      Z[j] = A[i][j]
      if _M[j]:
        continue
      _cnt += B[j]
    cnt = max(_cnt, cnt)
print(cnt)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
m=max(a)
s=0
for i in range(1,m+1):
  c=a.count(i)
  if c>i:
    s=s+c-i
  elif c<i:
    s=s+c
print(s)

### FIXED CODE ###

import collections as c
n=int(input())
a=list(map(int,input().split()))
d=c.Counter(a)
k=d.keys()
x=0
for i in k:
  if d[i]>i:
    x+=d[i]-i
  elif d[i]<i:
    x+=d[i]
print(x)
### BUGGY CODE ###

from fractions import gcd
from functools import reduce
from copy import copy
def gcd_list(numbers):
    return reduce(gcd, numbers)
ans = 0
N = int(input())
A = [int(n) for n in input().split()]

for i in range(N):
    B = copy(A)
    B.pop(i)
    tmp = gcd_list(B)
    if ans < tmp:
        ans = tmp
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(n) for n in input().split()]

from fractions import gcd
L = [0]*(N+1)
R = [0]*(N+1)
ans = 0
for i in range(N):
    L[i] = gcd(L[i-1],A[i])
for i in reversed(range(N)):
    R[i] = gcd(R[i+1],A[i])

for i in range(N):
    if gcd(L[i-1],R[i+1]) > ans:
        ans = gcd(L[i-1],R[i+1])
print(ans)
### BUGGY CODE ###

MOD=1000000007
N=input()
A = [int(x) for x in input().split()]
l=len(A)
s=0
for i in range(l):
    B=A[i+1:l]
    s+=A[i]*sum(B)
print(s%MOD)


### FIXED CODE ###

MOD=1000000007
N=input()
A = list(map(int,input().split()))
l=len(A)
s=0
B=sum(A)
for i in range(l):
    B-=A[i]
    s+=A[i]*B
print(s%MOD)
### BUGGY CODE ###

from collections import deque


def read():
    N, Q = list(map(int, input().strip().split()))
    G = [i for i in range(N+1)]
    PX = list()
    G[1] = 0  # 終点
    for i in range(N-1):
        a, b = list(map(int, input().strip().split()))
        G[b] = a  # 逆辺を張る
    for i in range(Q):
        px = list(map(int, input().strip().split()))
        PX.append(px)
    return N, Q, G, PX


def solve(N, Q, G, PX):
    C = [0 for i in range(N+1)]
    V = [-1 for i in range(N+1)]
    for p, x in PX:
        C[p] += x
    for i in range(N, 0, -1):
        node = i
        v = 0
        while node > 0:
            if V[node] > 0:  # use cache
                v += V[node]
                break
            v += C[node]
            node = G[node]
        V[i] = v
    return ' '.join(map(str, V[1:]))
    

if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
from collections import deque


def read():
    N, Q = list(map(int, input().strip().split()))
    G = [list() for i in range(N+1)]
    PX = list()
    for i in range(N-1):
        a, b = list(map(int, input().strip().split()))
        G[a].append(b)
        G[b].append(a)
    for i in range(Q):
        px = list(map(int, input().strip().split()))
        PX.append(px)
    return N, Q, G, PX


def bfs(parent, G, C, V):
    q = deque()
    q.append(1)
    while len(q) > 0:
        parent = q.pop()
        V[parent] = True
        for child in G[parent]:
            if not V[child]:
                C[child] += C[parent]
                q.append(child)
    

def solve(N, Q, G, PX):
    C = [0 for i in range(N+1)]
    V = [False for i in range(N+1)]
    for p, x in PX:
        C[p] += x
    bfs(1, G, C, V)
    return ' '.join(map(str, C[1:]))
    

if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

def main():
    s = input()[:-1]
    q = int(input())
    tmp = [input().split() for _ in range(q)]

    for i in range(len(tmp)):
        if len(tmp[i]) == 1:
            s = s[::-1]
        else:
            if int(tmp[i][1]) == 1:
                s = ''.join([tmp[i][2], s])
            else:
                s = ''.join([s, tmp[i][2]])
                
    print(s)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import deque

def main():
    input = sys.stdin.readline

    s = input()[:-1]
    q = int(input())
    tmp = [input().split() for _ in range(q)]

    flag = 0
    ans = deque([s])
    for t in tmp:
        if len(t) == 1:
            flag = ~flag 
        else:
            f = int(t[1])
            c = t[2]
            if (f == 1 and flag == 0) or (f ==2 and flag == -1):
                ans.appendleft(c)
            else:
                ans.append(c)
    if flag == 0:
        print(''.join(ans))
    else:
        print(''.join(ans)[::-1])

if __name__ == '__main__':
    main()
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = ""
for x in range(N):
    ans += " " + str(A.index(x+1) + 1)
print(ans.lstrip(" "))

### FIXED CODE ###

N = int(input())
A = map(int,input().split())
d = {}
for i, a in enumerate(A):
    d[a] = i + 1
ans = ""
for i in range(N):
    ans += " " + str(d[i+1])
print(ans.lstrip(" "))
### BUGGY CODE ###

from fractions import gcd
N=int(input())
a = list(map(int, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ans = 0
for i in a:
    ans += (lcm//i)%(10**9+7)
print(ans%(10**9+7))


### FIXED CODE ###

from fractions import gcd
N=int(input())
a = list(map(int, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ans = 0
for i in a:
    ans += (lcm//i)#%(10**9+7)
print(ans%(10**9+7))
### BUGGY CODE ###

K,S = (int(x) for x in input().split())
count = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z == S:
        count += 1

print(count)

### FIXED CODE ###

K,S = (int(x) for x in input().split())
count = 0
for x in range(K+1):
  for y in range(K+1):
    remain = S-x-y
    if 0 <= remain and remain <= K:
      count += 1

print(count)
### BUGGY CODE ###

import copy
N=int(input())
X=list(map(int, input().split()))
 
median=(N//2)-1
for i in range (N):
    X_instant=copy.deepcopy(X)
    X_instant.pop(i)
    X_instant.sort()
    output=X_instant[median]
    print(output)

### FIXED CODE ###

N=int(input())
X=list(map(int, input().split()))
 
import copy
X_sort=copy.deepcopy(X)
X_sort.sort()
X_sort
 
median_control=(X_sort[N//2-1]+X_sort[N//2])/2
for i in range (N):
    if X[i]>median_control:
        print (X_sort[N//2-1])
    if X[i]<=median_control:
        print (X_sort[N//2])
### BUGGY CODE ###

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]

ma,mb = AB[0]
for a, b in AB:
  i = 0
  while i*a < ma:
    i += 1
  j = 0
  while j*b < mb:
    j += 1
  k = max(i, j)
  
  ma = k*a
  mb = k*b
  
print(ma + mb)
   

### FIXED CODE ###

import math
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]

ma,mb = AB[0]
for a, b in AB[1:]:
  i = -(-ma //a)
  j = -(-mb //b)
  k = max(i, j)
  
  ma = k*a
  mb = k*b
  
print(ma + mb)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける
    graph = [ [] for i in range(N)]
    for edge in edges:
        a, b, c = edge
        graph[a].append((b,c))
        graph[b].append((a,c))
    return graph

def BFS(N, graph, start):
    Q = []
    V = []
    prev = [None] * N
    d = [float("inf")] * N
    Q.append(start)
    d[start] = 0
    while len(V) < N:
        a = Q.pop(0)
        V.append(a)
        for b, c in graph[a]:
            if b != prev[a]:
                Q.append(b)
                prev[b] = a
                d[b] = d[a] + c
    return d

N = int(input())
graph = [ [] for i in range(N)]
for i in range(N-1):
    a, b, c = (int(j) for j in input().split())
    graph[a-1].append((b-1,c))
    graph[b-1].append((a-1,c))

Q, K =(int(i) for i in input().split())

d = BFS(N, graph, K-1)
for i in range(Q):
    x, y = (int(a) for a in input().split())
    print(d[x-1] + d[y-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline

def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける
    graph = [ [] for i in range(N)]
    for edge in edges:
        a, b, c = edge
        graph[a].append((b,c))
        graph[b].append((a,c))
    return graph

def BFS(N, graph, start):
    Q = []
    V = []
    prev = [None] * N
    dd = [float("inf")] * N
    Q.append(start)
    dd[start] = 0
    while len(V) < N:
        a = Q.pop(0)
        V.append(a)
        for b, c in graph[a]:
            if b != prev[a]:
                Q.append(b)
                prev[b] = a
                dd[b] = dd[a] + c
    return dd

def DFS(N, graph, a, p, d):
    dd[a] = d
    for b, c in graph[a]:
        if b == p or dd[b] != 0:
            continue
        else:
            DFS(N, graph, b, a, d + c)

N = int(input())
graph = [ [] for i in range(N)]
for i in range(N-1):
    a, b, c = (int(j) for j in input().split())
    graph[a-1].append((b-1,c))
    graph[b-1].append((a-1,c))

Q, K =(int(i) for i in input().split())
dd = [0] * N

try:
    DFS(N, graph, K-1, -1, 0)
except:
    dd = BFS(N, graph, K-1)

for i in range(Q):
    x, y = (int(a) for a in input().split())
    print(dd[x-1] + dd[y-1])
### BUGGY CODE ###

N,K = map(int, input().split())
A=list(map(int, input().split()))
s = 1
for i in range(K):
    s *= A[i]
j = 0
for i in range(K,N):
    x = s / A[j] * A[i]
    if x > s:
        print("Yes")
    else:
        print("No")
    s = x
    j += 1


### FIXED CODE ###

N,K = map(int, input().split())
A=list(map(int, input().split()))
j = 0
for i in range(K,N):
    if A[j] < A[i]:
        print("Yes")
    else:
        print("No")
    j += 1
### BUGGY CODE ###

N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
ans = [k for k, v in S.items() if v == max(S.values())]
ans.sort()

# 出力
for a in ans:
    print(a)


### FIXED CODE ###

N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
# ans = [k for k, v in S.items() if v == max(S.values())]
# ans.sort()
max_value = max(S.values())
ans = sorted([k for k, v in S.items() if v == max_value])

# 出力
for a in ans:
    print(a)
### BUGGY CODE ###

S = input()
leng = len(S)

count = [0] * 2019
count[0] = 1

num = 0
d = 1

for i in range(leng):
    num = int(S[i:])
    num %= 2019
    count[num] += 1
    d *= 10


res = 0
for cnt in count:
    res += cnt * (cnt - 1) // 2
print(res)

### FIXED CODE ###

s = input()[::-1]

counts = [0] * 2019
counts[0] = 1

num, d = 0, 1

for char in s:
    num += int(char) * d
    num %= 2019
    d *= 10
    d%= 2019
    counts[num] += 1

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2

print(ans)
### BUGGY CODE ###

#三井住友2019 D
def main():
    import sys
    import itertools as ite
    N = int(sys.stdin.readline())
    S = sys.stdin.readline().rstrip()
    #print(N-3)
    #print(S)
    L = set(list(ite.combinations(S, 3)))
    print(len(L))

if __name__=='__main__':
    main()


### FIXED CODE ###

#三井住友2019 D 貪欲法
def main():
    import sys
    N = int(sys.stdin.readline())
    S = sys.stdin.readline().rstrip()
    ans = 0
    for i in range(1000):
        num = str(i).zfill(3)
        L = []
        k = 0
        for j in range(N):
            #print(num, S[j])
            if int(S[j])==int(num[k]):
                #print('Yes', num)
                L.append(S[j])
                k+=1
            if len(L)==3:
                #print(L)
                ans +=1
                break
                
    print(ans)
        
    
if __name__=='__main__':
    main()