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

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,S = LI()
A = LI()

beki = [1]*(N+1)
for i in range(1,N+1):
    beki[i] = beki[i-1]*2
    beki[i] %= mod

inv2 = pow(2,mod-2,mod)

d = defaultdict(int)
d[0] = beki[N]

ans = 0
for i in range(N):
    if 0 <= S-A[i] <= S:
        ans += d[S-A[i]]*inv2
        ans %= mod
    kl = list(d.keys())
    diff = defaultdict(int)
    for k in kl:
        if 0 < k+A[i] <= S:
            diff[k+A[i]] = d[k]*inv2
    for k in diff.keys():
        d[k] += diff[k]

print(ans)

### FIXED CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,S = LI()
A = LI()

beki = [1]*(N+1)
for i in range(1,N+1):
    beki[i] = beki[i-1]*2
    beki[i] %= mod

inv2 = pow(2,mod-2,mod)

d = [0]*(S+1)
d[0] = beki[N]

ans = 0
for i in range(N):
    if 0 <= S-A[i] <= S:
        ans += d[S-A[i]]*inv2
        ans %= mod
    diff = [0]*(S+1)
    for k in range(S-A[i]+1):
        diff[k+A[i]] = d[k]*inv2
    for k in range(S+1):
        d[k] += diff[k]
        d[k] %= mod

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

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

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += A[i]*A[j]
    
print(ans%((10**9)+7))

### FIXED CODE ###

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

ans = 0
s = sum(A)
for i in range(N-1):
    s -= A[i]
    ans += A[i]*s
    
print(ans%((10**9)+7))
### BUGGY CODE ###

from heapq import heappush, heappop
n,m=map(int,input().split())
works = []
for _ in range(n):
	a,b=map(int,input().split())
	if a>m:
		continue
	works.append((a,b))
works.sort()
q=[]
ans=0

for dayleft in range(1,m+1):
	while works and works[0][0]<=dayleft:
		a,b=works.pop(0)
		heappush(q,-b)
	if q:
		b = -heappop(q)
		ans+=b
print(ans)

### FIXED CODE ###

from heapq import heappush, heappop
n,m=map(int,input().split())
works = []
for _ in range(n):
	a,b=map(int,input().split())
	if a>m:
		continue
	works.append((a,b))
works.sort(reverse=True)
q=[]
ans=0

for dayleft in range(1,m+1):
	while works and works[-1][0]<=dayleft:
		a,b=works.pop()
		heappush(q,-b)
	if q:
		b = -heappop(q)
		ans+=b
print(ans)
### BUGGY CODE ###

# import bisect
# # import heapq
# # from copy import deepcopy
from collections import deque
# # from collections import Counter
# # from itertools import accumulate
# # from itertools import permutations
# import numpy as np
# # import math

n, m, k = map(int, input().split())
# a = list(map(int, input().split()))
# n = int(input())

friend =[[] for _ in range(n)]
block = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a,b = a-1,b-1
    friend[a].append(b); friend[b].append(a)

for i in range(k):
    c,d = map(int, input().split())
    c,d = c-1,d-1
    block[c].append(d); block[d].append(c)

def suggest(s):
    count = 0
    seen = [False] * n
    que = deque([s])
    while que:
        start = que.popleft()
        seen[start] = True
        for i in friend[start]:
            if seen[i]: continue
            else:
                que.append(i)

    for i in range(n):
        if i != s and seen[i] and (i not in friend[s]) and (i not in block[s]):
            count += 1

    return count

for i in range(n):
    print(suggest(i))





### FIXED CODE ###

# import bisect
# # import heapq
# # from copy import deepcopy
from collections import deque
# # from collections import Counter
# # from itertools import accumulate
# # from itertools import permutations
# import numpy as np
# # import math

n, m, k = map(int, input().split())
# a = list(map(int, input().split()))
# n = int(input())

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 same(self, x, y):
        return self.find(x) == self.find(y)

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

uf = UnionFind(n)
friend =[[] for _ in range(n)]
block = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a,b = a-1,b-1
    uf.union(a,b)
    friend[a].append(b); friend[b].append(a)

for i in range(k):
    c,d = map(int, input().split())
    c,d = c-1,d-1
    if uf.same(c,d):
        block[c].append(d); block[d].append(c)

w = [0] * n
for i in range(n):
    w[i] = uf.size(i) - len(friend[i]) - len(block[i]) - 1

print(*w)
### BUGGY CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
MOD=10**9+7
def comb(a,b):
    b=min(a-b,b)
    x,y=1,1
    for i in range(b):
        x*=a-i
        y*=i+1
    return x*pow(y,MOD-2,MOD)%MOD
ans=0
for i in range(N-K+1):
    ans=ans+comb(N-1-i,K-1)*(A[N-1-i]-A[i])%MOD
    ans%=MOD
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
MOD=10**9+7
fan=[1]*(N+1)
for i in range(2,N+1):
    fan[i]=fan[i-1]*(i)%MOD
ans=0
def comb(a,b):
    return fan[a]*pow(fan[b],MOD-2,MOD)*pow(fan[a-b],MOD-2,MOD)%MOD
for i in range(N-K+1):
    ans=ans+comb(N-i-1,K-1)*(A[N-1-i]-A[i])
    ans%=MOD
print(ans)
### BUGGY CODE ###

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

def xor(n):
    c = 0
    for a in A:
        c += (n^a)
    return c

ans = []

for i in range(K + 1):
    ans.append(xor(i))

print(max(ans))


### FIXED CODE ###

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

"""
方針　各桁を0にするか1にするかは独立に考えてよい
 
K = 10101 の時
0か1か好きに選べる桁をfとして
* X = 10101
* X = 10100
* X = 100ff
* X = 0ffff
を試し、最大になるものを選ぶ
 
2**39 < 10**12 < 2**40　なので40桁について考え
fのときどっちを選ぶとよいかを前計算しておく
""" 
 
L = [0]*40  # (i桁目が1である数)
for i in range(N):
    for j in range(40):
        L[j] += (A[i] >> j)&1
 
default = [(N - L[i]) * (2**i) if (K>>i)&1 == 1 else L[i] * (2**i) for i in range(40)]
free = [max(L[i] * (2**i), (N-L[i])*(2**i)) for i in range(40)]
 
ans = sum([K^A[i] for i in range(N)])
for i in range(40):
    if (K >> i)&1 == 1:
        ans = max(ans,
                  sum(free[:i]) + L[i]*(2**i) + sum(default[i+1:]))
print(ans)
### BUGGY CODE ###

import math
n, k = map(int, input().split())
a = int(n/k)
if(a < 2):
    b = 0
else:
    b = math.factorial(a) // (math.factorial(a - 2) * math.factorial(2))
if(a < 3):
    c = 0
else:
    c = math.factorial(a) // (math.factorial(a - 3) * math.factorial(3))
ans = a + b * 6 + c * 6
if(k % 2 == 0):
    t = int(k / 2)
    if(a * k + t > n):
      ans = ans * 2
    else:
      d = a + 1
      if(d < 2):
          e = 0
      else:
          e = math.factorial(d) // (math.factorial(d - 2) * math.factorial(2))
      if(d < 3):
          f = 0
      else:
          f = math.factorial(d) // (math.factorial(d - 3) * math.factorial(3))
      ans += (d + e * 6 + f * 6)
print(ans)

### FIXED CODE ###

import math

n, k = map(int, input().split())

ans = int(math.pow(int(n/k),3))

if(k % 2 == 0):
  m = int( (n+int(k/2))/ k )
  ans += int(math.pow(m,3))

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

N = int(input())
S = input()
ans = 0
  
ans = 0
for i1 in range(10):
  for i2 in range(10):
    for i3 in range(10):
      n1 = 0
      n2 = 0
      n3 = 0
      p1 = 0
      p2 = 0
      p3 = 0
      while(p1 < len(S)):
        if(int(S[p1]) == i1):
          p2 = p1 + 1
          n1 = 1
          break
        p1 += 1
      while(p2 < len(S)):
        if(int(S[p2]) == i2):
          p3 = p2 + 1
          n2 = 1
          break
        p2 += 1
      while(p3 < len(S)):
        if(int(S[p3]) == i3):
          n3 = 1
          break
        p3 += 1
      if(n1 == 1 and n2 == 1 and n3 == 1):
        ans += 1
        
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
  
ans = 0
for i1 in range(10):
  for i2 in range(10):
    for i3 in range(10):
      p = 1
      for f in range(N):
        if(p == 1 and S[f] == str(i1)):
          p = 2
        elif(p == 2 and S[f] == str(i2)):
          p = 3
        elif(p == 3 and S[f] == str(i3)):
          ans += 1
          break
        
print(ans)
### BUGGY CODE ###

import itertools
n=int(input())
S=list(input())

number=set(itertools.combinations(S,3))
print(len(number))


### FIXED CODE ###

n=int(input())
S=input()

ans=0
for i in range(10):
  for j in range(10):
    for k in range(10):
      idxi=S.find(str(i))
      if idxi==-1:
        continue
      idxj=S.find(str(j),idxi+1)
      if idxj==-1:
        continue
      idxk=S.find(str(k),idxj+1)
      if idxk==-1:
        continue
      ans+=1
print(ans)
### BUGGY CODE ###

from sys import stdin

n, k = [int(x) for x in stdin.readline().strip().split()]
h_lst = [int(x) for x in stdin.readline().strip().split()]
min_cost_lst = [0] + [10**10] * (n-1)

for i in range(n):
  for j in range(1, k+1):
    if i + j < n and min_cost_lst[i] < min_cost_lst[i+j]:
      min_cost_lst[i + j] = min(min_cost_lst[i + j], min_cost_lst[i] + abs(h_lst[i+j] - h_lst[i]))

print(min_cost_lst[-1])

### FIXED CODE ###

import numpy as np

def main():
  N, K = map(int, input().split())
  h = list(map(int, input().split()))

  INF = 10**10

  dp = [INF]*N
  dp[0] = 0

  dp = np.array(dp)
  h = np.array(h)

  for i in range(N):
    T = min(N,i+K+1)
    dp[i+1:T] = np.minimum(dp[i+1:T], dp[i] + abs(h[i+1:T]-h[i]))

  print(dp[N-1])
  
if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
from fractions import gcd
import bisect

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]



n, m = na()
a = na()
a.sort()

for i in range(m):
    b, c = na()
    for j in range(b):
        if a[0] < c:
            a.pop(0)
            inid = bisect.bisect_left(a, c)
            a.insert(inid, c)
        else:
            break
    a.sort()

print(sum(a))

### FIXED CODE ###

import sys
import math
import numpy as np
import bisect
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n, m = na()
a = na()
bc = []

for _ in range(m):
    bci = na()
    bc.append(bci)

bc.sort(key=lambda x:x[1], reverse=True)
#print(bc)

bi, ci = bc[0][0], bc[0][1]
i = 0
for _ in range(n):
    if bi != 0:
        bi -= 1
        a.append(ci)
    else:
        i += 1
        if i > (m - 1):
            break
        else:
            bi, ci = bc[i][0], bc[i][1]
            bi -= 1
            a.append(ci)

a.sort(reverse=True)
print(sum(a[:n]))
### BUGGY CODE ###

n, q = map(int, input().split())
s = input()
cnt_AC = [0] * (n - 1)

for i in range(n - 1):
    if s[i] == "A" and s[i + 1] == "C":
        cnt_AC[i] += 1

for i in range(q):
    l, r = map(int, input().split())
    print(sum(cnt_AC[l - 1:r - 1]))
        
    

### FIXED CODE ###

n, q = map(int, input().split())
s = input()
cnt_AC = [0] * n
cnt = 0

for i in range(n - 1):
    if s[i] == "A" and s[i + 1] == "C":
        cnt += 1
    cnt_AC[i + 1] = cnt

for i in range(q):
    l, r = map(int, input().split())
    print(cnt_AC[r - 1] - cnt_AC[l - 1])
### BUGGY CODE ###

n,a,b=map(int,input().split())
h=[-1*int(input()) for _ in range(n)]

import heapq  # heapqライブラリのimport
#heapq.heapify(a)  # リストを優先度付きキューへ
#heapq.heappop(a)  # 最小値の取り出し
#heapq.heappush(a, -2)

heapq.heapify(h)

#直撃a、爆風b
cnt=1
while 1:
    tmp=heapq.heappop(h)*(-1)
    tmp=tmp-a+b
    heapq.heappush(h,(-1)*tmp)
    
    if h[0]*(-1)-b*cnt<=0:
        print(cnt)
        break
    cnt+=1






### FIXED CODE ###

n,a,b=map(int,input().split())
h=[int(input()) for _ in range(n)]

#二部探索

ll=0
rr=10**9+1
ab=a-b
while ll<rr:
    half=(ll+rr)//2

    cnt=0
    for hh in h:
        if hh>b*half:
            cnt+=(-1*((-1*(hh-b*half))//ab))
    
    if cnt>half:
        ll=half+1
    elif cnt<half:
        rr=half
    else:
        print(half)
        exit()
print(ll)
### BUGGY CODE ###

def main():
    import sys
    input = sys.stdin.readline
    from itertools import accumulate

    def e(dice):
        return sum([r / dice for r in range(1, dice+1)])

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

    p_cum = [0] + list(accumulate(p))

    ma = 0
    ind = 0
    for i in range(k, n+1):
        if ma < p_cum[i] - p_cum[i-k]:
            ma = p_cum[i] - p_cum[i-k]
            ind = i

    x = p[ind-k:ind]

    print(sum(e(d) for d in x))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    from itertools import accumulate

    def e(dice):
        ans = 0
        for r in range(1, dice+1):
            ans += r /dice
        return ans

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

    p_cum = [0] + list(accumulate(p))

    ma = 0
    ind = 0
    for i in range(k, n+1):
        temp = p_cum[i] - p_cum[i-k]
        if ma < temp:
            ma = temp
            ind = i

    x = p[ind-k:ind]

    print(sum(e(d) for d in x))

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

N=int(input())
line=input()
line=line.rstrip().split(" ")
list1=[]
for i in range(N):
    list1.append(int(line[i])-i-1)
#print(list1)

list2=[]
list3=[]
for j in range(2):
    for k in range(N):
        list2.append(abs(list1[k]-1-j))
        
    list3.append(sum(list2))
    list2=[]
#print(list3)

if list3[0]==list3[1]:
    print(list3[0])
elif list3[0]<list3[1]:
    list2=[]
    list3=[]
    count=100000000000000000
    for l in range(1000000000):
        for m in range(N):
            list2.append(abs(list1[m]-1+l))
        if count>=sum(list2):
            count=sum(list2)
            #print(list2)
            list2=[]
        else:
            print(count)
            #print(list2)
            break
        
else: 
    list2=[]
    list3=[]
    count=100000000000000000
    for l in range(1000000000):
        for m in range(N):
            list2.append(abs(list1[m]-1-l))
        if count>=sum(list2):
            count=sum(list2)
            list2=[]
        else:
            print(count)
            #print(list2)
            break
        

### FIXED CODE ###

N=int(input())

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

if N==1:
    print(0)
    exit()
elif N==2:
    B=[A[0]-1,A[1]-2]
    b=sum(B)//2
else:
    B=[]
    for i in range(N):
        B.append(A[i]-(1+i))
    #print(B)
    B.sort()
    #print(B)
    b=B[N//2]

ans=0
for i in range(N):
    ans+=abs(A[i]-(b+1+i))
print(ans)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
mx=0
alarge=a[n-1]
if a[0]>=alarge/2:
  asmall=0
  comb=1
  for i in range(1,asmall+1): comb*=(alarge-i+1)/i
else:
  j=0
  while a[j]<alarge/2:
    j+=1
  if alarge<=a[j-1]+a[j]:
    asmall=a[j-1]
  else:
    asmall=a[j]
  comb=1
  for i in range(1,asmall+1): comb*=(alarge-i+1)/i
print("{} {}".format(alarge,asmall))


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
alarge=a[n-1]
if a[0]>=alarge/2:
  asmall=a[0]
else:
  j=0
  while a[j]<alarge/2:
    j+=1
  if alarge<=a[j-1]+a[j]:
    asmall=a[j-1]
  else:
    asmall=a[j]
print("{} {}".format(alarge,asmall))
### BUGGY CODE ###

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

mod = 10**9 + 7

A.sort(reverse=True)
B.sort(reverse=True)
A.append(N*M + 1)
B.append(N*M + 1)

space = 0
A_used = 0
B_used = 0
ans = 1
for i in range(M * N, 0, -1):
    if i == A[0]:
        if i == B[0]:
            space += (A_used + B_used)
            A_used += 1
            B_used += 1
            del A[0]
            del B[0]
        else:
            space += (B_used - 1)
            A_used += 1
            del A[0]
            ans = (ans * B_used) % mod
    elif i == B[0]:
        space += (A_used - 1)
        B_used += 1
        del B[0]
        ans = (ans * A_used) % mod
    else:
        ans *= space
        space -= 1
        if space < 0:
            break

print(ans % mod)

### FIXED CODE ###

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

mod = 10**9 + 7

A.sort(reverse=True)
B.sort(reverse=True)
A.append(N*M + 1)
B.append(N*M + 1)

space = 0
A_used = 0
B_used = 0
ans = 1
for i in range(M * N, 0, -1):
    if i == A[0]:
        if i == B[0]:
            space += (A_used + B_used)
            A_used += 1
            B_used += 1
            del A[0]
            del B[0]
        else:
            space += (B_used - 1)
            A_used += 1
            del A[0]
            ans = (ans * B_used) % mod
    elif i == B[0]:
        space += (A_used - 1)
        B_used += 1
        del B[0]
        ans = (ans * A_used) % mod
    else:
        ans = (ans * space) % mod
        space -= 1
        if space < 0:
            break

print(ans % mod)
### BUGGY CODE ###

N, M = map(int, input().split())
S = str(input())
T = str(input())

if M > N:
	M, N = N, M
	S, T = T, S

import math
G = N*M//math.gcd(N, M)

A = []
B = []

for i in range (0, N):
	A.append(1+i*G//N) 
for i in range (0, M):
	B.append(1+i*G//M)

import bisect
FA = []
FB = []

for i in range (0, M):
	if A.count(B[i]) != 0:
		FA.append(A.index(B[i]))
		FB.append(i)
        
for i in range (0, len(FA)):
	if S[FA[i]] != T[FB[i]]:
		print(-1)
		exit()
print(G)

### FIXED CODE ###

N, M = map(int, input().split())
S = str(input())
T = str(input())

if M > N:
	M, N = N, M
	S, T = T, S

import math
G = N*M//math.gcd(N, M)

A = []
B = []

C = N//math.gcd(N,M)
D = M//math.gcd(N,M)

for i in range (0, math.gcd(N,M)):
	if S[i*C] != T[i*D]:
		print(-1)
		exit()

print(G)
### BUGGY CODE ###

def remove_from(arr, item):
    if item in arr:
        arr.remove(item)

(n, m) = list(map(int, input().split()))
hights = list(map(int, input().split()))
tmap = {}
for i, h in enumerate(hights):
    tmap[i + 1] = h

nlist = list(range(1, n + 1))
for i in range(m):
    (s, d) = list(map(int, input().split()))
    if tmap[s] < tmap[d]:
        remove_from(nlist, s)
    elif tmap[s] > tmap[d]:
        remove_from(nlist, d)
    else:
        remove_from(nlist, s)
        remove_from(nlist, d)
print(len(nlist))

### FIXED CODE ###

(n, m) = list(map(int, input().split()))
hights = list(map(int, input().split()))

bads = set([])
for _ in range(m):
    (s, d) = list(map(int, input().split()))
    if hights[s-1] < hights[d-1]:
        bads.add(s)
    elif hights[s-1] > hights[d-1]:
        bads.add(d)
    elif hights[s-1] == hights[d-1]:
        bads.add(s)
        bads.add(d)
print(len(hights) - len(bads))
### BUGGY CODE ###

import math

N = int(input())
A = [int(i) for i in input().split()]
flag =False
ans = math.gcd(A[0], A[1])
tmp = math.gcd(A[0], A[1])
maxa = (A[0] * A[1] // math.gcd(A[0], A[1]))
if tmp > 1:
    flag = True
for i in range(2, N):
    ans = math.gcd(ans, A[i])
    tmp = math.gcd(maxa, A[i])
    if tmp > 1:
        flag = True
    maxa = (maxa * A[i]) // tmp
if ans > 1:
    print('not coprime')
    exit()
if flag:
    print('setwise coprime')
else:
    print('pairwise coprime')

### FIXED CODE ###

import math

def sieve_of_erastosthenes(num):
    is_prime = [True for i in range(num+1)]
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(num**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, num + 1, i):
            is_prime[j] = False
    return [i for i in range(num + 1) if is_prime[i]]

N = int(input())
A = [int(i) for i in input().split()]
ans = math.gcd(A[0], A[1])
tmp = math.gcd(A[0], A[1])
for i in range(2, N):
    ans = math.gcd(ans, A[i])
if ans > 1:
    print('not coprime')
    exit()
maxA = max(A)
l = sieve_of_erastosthenes(maxA)
B = [False for i in range(maxA+1)]
for i in range(N):
    B[A[i]] = True
flag = False
for each in l:
    tmp = each
    counter = 0
    while True:

        if B[tmp]:
            counter += 1
        tmp += each
        if tmp > maxA:
            break
    if counter > 1:
        flag = True
        break


if flag:
    print('setwise coprime')
else:
    print('pairwise coprime')
### BUGGY CODE ###

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

dic={}
for i in range(N):
    if A[i] not in dic:
        dic[A[i]]=1
    else:
        dic[A[i]]+=1

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

if 1 in dic:
    if dic[1]>1:
        print(0)
        exit()
    else:
        print(1)
        exit()

def make_divisors(n):
    divisors=[]
    for j in range(2, int(n**0.5)+1):
        if n%j==0:
            divisors.append(j)
            if j!=n//j:
                divisors.append(n//j)
 
    return divisors

ans=0
for i in range(N):
    if dic[A[i]]>1:
        continue
    f=False
    for j in range(2, int(A[i]**0.5)+1):
        if A[i]%j==0:
            if j in dic or A[i]//j in dic:
                f=True
                break
    if f:
        continue
    ans+=1

print(ans)

### FIXED CODE ###

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

M=max(A)
check=[0]*(M+1)
for i in range(N):
    a=A[i]
    while a<=M:
        check[a]+=1
        a+=A[i]
ans=0
for i in range(N):
    if check[A[i]]==1:
        ans+=1

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

import sys
input = sys.stdin.readline
from functools import lru_cache
sys.setrecursionlimit(10 ** 8)

shina = []
N = 0


@lru_cache(maxsize=None)
def solve(i, j):
    global N
    if i == N:
        return 0

    if shina[i][0] > j:
        return solve(i + 1, j)

    return max(solve(i + 1, j), solve(i + 1, j - shina[i][0]) + shina[i][1])


def main():
    global N
    N, W = [int(x) for x in input().split()]
    for i in range(N):
        a, b = [int(x) for x in input().split()]
        shina.append([a, b])

    ans = solve(0, W)

    print(ans)

if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys
input = sys.stdin.readline


def main():
    N, W = [int(x) for x in input().split()]
    shina = []
    for i in range(N):
        a, b = [int(x) for x in input().split()]
        shina.append([a, b])

    dp = [[0 for i in range(N + 1)] for j in range(W + 1)]

    for i in range(N - 1, -1, -1):
        for j in range(W + 1):
            if shina[i][0] > j:
                dp[j][i] = dp[j][i + 1]
            else:
                dp[j][i] = max(dp[j][i + 1], dp[j - shina[i][0]][i + 1] + shina[i][1])

    ans = 0
    for j in range(W + 1):
        ans = max(ans, max(dp[j]))

    print(ans)


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

N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = [0] * (N)
temp = 1
for i in range(K):
    temp *= A[i]
ans[K - 1] = temp
for i in range(K, N):
    ans[i] = ans[i - 1] * A[i] // A[i - K]
    if ans[i] > ans[i - 1]:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = [0] * (N)
temp = 1
# for i in range(K):
#     temp *= A[i]
# ans[K - 1] = temp
for i in range(K, N):
    if A[i] > A[i - K]:
        # ans[i] = ans[i - 1] * A[i] // A[i - K]
        # if ans[i] > ans[i - 1]:
        print('Yes')
    else:
        print('No')