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


import sys
sys.setrecursionlimit(200005)

n, q = [int(i) for i in input().split()]

ab = []
for i in range(n-1):
    ab.append([int(i) for i in input().split()])

px = []
for i in range(q):
    px.append([int(i) for i in input().split()])

graph = [[] for _ in range(n+1)]
for a, b in ab:
    graph[a].append(b)
    graph[b].append(a)

counter = [0] * (n+1)

for p, x in px:
    counter[p] += x

def count(node, parent=0):
    for leaf in graph[node]:
        if leaf == parent:
            continue
        counter[leaf] += counter[node]
        count(leaf, node)

count(1)

for counter_i in counter[1:]:
    print(counter_i, end=" ")


### FIXED CODE ###

from collections import deque

n, q = [int(i) for i in input().split()]

tree = [[] for _ in range(n+1)]
for _ in range(n-1):
    a, b = [int(i) for i in input().split()]
    tree[a].append(b)
    tree[b].append(a)

counter = [0] * (n+1)
for _ in range(q):
    p, x = [int(i) for i in input().split()]
    counter[p] += x

queue = deque([[0,1]])
while queue:
    parent, node = queue.popleft()
    for leaf in tree[node]:
        if leaf == parent:
            continue
        counter[leaf] += counter[node]
        queue.append([node, leaf])

print(*counter[1:])
### BUGGY CODE ###

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

broken_step = []
for _ in range(M):
    broken_step.append(int(input()))

import sys
sys.setrecursionlimit(10000000)

mod = 1000000007

memo = [-1] * (N+1)

if 0 not in broken_step:
    memo[0] = 1
elif N == 0 and N in broken_step:
    memo[0] = 0

if 1 not in broken_step:
    memo[1] = 1
elif 1 in broken_step:
    memo[1] = 0

def step_memo(N):
    
    if N in broken_step:
        return 0
        
    if memo[N] != -1:
        return memo[N]
    
    memo[N] =  (step_memo(N-1) + step_memo(N-2)) % mod
    return (step_memo(N-1) + step_memo(N-2)) % mod
  
print(step_memo(N))

### FIXED CODE ###

N, M = map(int, input().split())
import sys
sys.setrecursionlimit(10000000)

mod = 1000000007

memo = [-1] * (N+1)

for _ in range(M):
    broken_step = int(input())
    memo[broken_step] = 0
    
memo[0] = 1
if memo[1] == -1:
    memo[1] = 1

def step_memo(N):
    
    if memo[N] != -1:
        return memo[N]
    
    memo[N] =  (step_memo(N-1) + step_memo(N-2)) % mod
    return (step_memo(N-1) + step_memo(N-2)) % mod
  
print(step_memo(N))
### BUGGY CODE ###

n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))
mod = 10 ** 9+ 7

com = [0, 1]
for i in range(n):
    if (i + 1) in a:
        com.append(0)
    else:
        com.append((com[-1] + com[-2]) % mod)
print(com[-1])

### FIXED CODE ###

n, m = map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))
a = set(a)
mod = 10 ** 9+ 7

com = [0, 1]
for i in range(n):
    if (i + 1) in a:
        com.append(0)
    else:
        com.append((com[-1] + com[-2]) % mod)
print(com[-1])
### BUGGY CODE ###

N, K, Q = list(map(int, input().strip().split()))
As = [int(input()) for _ in range(Q)]

points = [K for _ in range(N)]
for A in As:
    for i in range(len(points)):
        if not i == A:
            points[i - 1] -= 1

for p in points:
    if p > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

import numpy as np

N, K, Q = list(map(int, input().strip().split()))
As = [int(input()) for _ in range(Q)]

points = np.asarray([K for _ in range(N)])

points -= Q
for A in As:
    points[A - 1] += 1

for p in points:
    if p > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort(reverse = True)
    M = max(A)
    ex = [0 for _ in range(M+1)]
    for i in range(N):
        ex[A[i]] += 1
        
    
    def exp(x):
        ans = 1
        while x >= ans:
            ans *= 2
        return ans

    ans = 0
    for i in range(N):
        use = A[i]
        if ex[use] == 0:
            continue
        ex[use] -= 1
        pare = exp(use)-use
        if ex[pare] != 0:
            ex[pare] -= 1
            ans += 1
    
    print(ans)
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import defaultdict
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int,input().split()))
    d = defaultdict(int)
    for x in A:
        d[x] += 1
    A = list(set(A))
    A.sort(reverse = True)
    l = len(A)
    
    def exp(x):
        l = len(str(bin(x))[2:])
        return 2**l

    ans = 0
    for i in range(l):
        a = A[i]
        if exp(a)//2 == a:
            ans += int(d[a]//2)
        else:
            m = min(d[a],d[exp(a)-a])
            ans += m
            d[a] -= m
            d[exp(a)-a] -= m
            
    print(ans)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1, n):
            if ((l[i] + l[j]) > l[k]) & ((l[j]+l[k]) > l[i]) & ((l[k]+l[i]) > l[j]):
                ans += 1 
print(ans)

### FIXED CODE ###

import bisect
n = int(input())
l = sorted(list(map(int, input().split())))
ans=0
for i in range(n-2):
    for j in range(i+1,n-1):
        ans+=bisect.bisect_left(l, l[i] + l[j]) - j - 1
print(ans)
### BUGGY CODE ###

import sys
def solve(n,m,a):
    ans = ""
    b = [[] for i in range(n)]
    for s1,s2 in a:
        b[s1-1].append(s2)
    for i in range(len(b)):
        b[i].sort()
    zero = ["00000","0000","000","00","0",""]
    for i in range(m):
        ken = str(a[i][0])
        ban = str(b[a[i][0]-1].index(a[i][1])+1)
        ans += zero[len(ken)-1] + ken + zero[len(ban)-1] + ban + "\n"
    
    return ans 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    M = int(ws[1])
    ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]
    return (N, M, ls_PY)

def main():
    N, M, ls_PY = readQuestion()
    answer = solve(N, M, ls_PY)
    print(answer)

if __name__ == '__main__':
    main()

### FIXED CODE ###

N,M=map(int,input().split())
PY=[list(map(int,input().split()))+[i] for i in range(M)] #定義終了
 
PY.sort(key= lambda x:x[1])
num=[0]*N
w=[""]*M
 
for p,y,i in PY:
	num[p-1]+=1
	w[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)

for i in range(M):
  	print(w[i])
### BUGGY CODE ###

import numpy as np
n, h =[int(i) for i in input().split()]
ab = np.empty((n,2),dtype=int)
for i in range(n):
    ab[i,:] = np.array([int(i) for i in input().split()])
np.sort(ab[:,0])
a = ab[:,0]
b = ab[:,1]
sort_a_idx =  np.argsort(a)
sort_b_idx = np.argsort(b)
sort_a =ab[sort_a_idx,0]
sort_b =ab[sort_b_idx,1]
max_a = sort_a[-1]
b_sum = np.sum(b[b>max_a])
if b_sum > h:
    for i in range(1,n+1):
        if np.sum(sort_b[-i:]) > h:
            ret = i
            break
else:
    ret = len(b[b>max_a])
    ret += np.ceil((h -b_sum)/max_a)
print(str(int(ret)))

### FIXED CODE ###

import numpy as np
n, h =[int(i) for i in input().split()]
a = np.empty(n)
b = np.empty(n)
for i in range(n):
    a[i], b[i] = [int(i) for i in input().split()]
sort_b = np.sort(b)
max_a = np.max(a)
b_big = sort_b[sort_b>max_a]
b_sum = np.sum(b_big)
if b_sum >= h:
    ret = np.sum(b_big[::-1].cumsum() <h) + 1 
else:
    ret = b_big.shape[0]
    ret += np.ceil((h -b_sum)/max_a)
print(int(ret))
### BUGGY CODE ###

N,M = map(int,input().split())
path = [[] for _ in range(N*3+3)]
for _ in range(M):
    u,v = map(int,input().split())
    path[u].append(v+N)
    path[u+N].append(v+N+N)
    path[u+N+N].append(v)

S,T = map(int,input().split())
import collections

q = collections.deque()
vis = [-1 for _ in range(N*3+3)]
def bfs():
    while len(q) > 0:
        now,cnt = q.popleft()
        #print(now,T,cnt,path[now],q)
        vis[now] = cnt
        if now == T: 
            return cnt
        for x in path[now]:
            if vis[x] == -1:
                q.append((x,cnt+1))
vis[S] = 1
q.append([S,0])
ans = bfs()
if vis[T] == -1: print(-1)
else: print(ans//3)




### FIXED CODE ###

N,M = map(int,input().split())
import time
start_t = time.time()
path = [[] for _ in range(N+3)]
for _ in range(M):
    u,v = map(int,input().split())
    path[u].append(v)

S,T = map(int,input().split())
import collections

q = collections.deque()
vis = [[-1 for _ in range(3)] for _ in range(N+3)]
vis[S][0] = 1
q.append([S,0])
while len(q):
    now,cnt = q.popleft()
    step = cnt % 3
    for x in path[now]:
        if vis[x][(step+1)%3] < 0:
            vis[x][(step+1)%3] = cnt
            q.append((x,cnt+1))

if vis[T][0] == -1:
    print(-1)
else:
    print(vis[T][0]//3+1)
### BUGGY CODE ###

n, q = map(int, input().split())
s = list(input())
l,r = [0] * q, [0] * q
for i in range(q):
    l[i], r[i] = map(int, input().split())

for i in range(q):
    cnt = 0
    for j in range(l[i] - 1, r[i]):
        if j == r[i] - 1:
            break
        if s[j] == "A" and s[j + 1] == "C":
            cnt += 1
    print(cnt)

### FIXED CODE ###

n, q = map(int, input().split())
s = list(input())
l,r = [0] * q, [0] * q
for i in range(q):
    l[i], r[i] = map(int, input().split())

#acの場所把握
ac = [0] * (n + 1)
for i in range(n - 1):
    if s[i] == "A" and s[i + 1] == "C":
        ac[i + 1] = ac[i] + 1
    else:
        ac[i + 1] = ac[i]

for i in range(q):
    print(ac[r[i] - 1] - ac[l[i] - 1])
### BUGGY CODE ###

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

x=N
dammy=[]
while x > N//(1.1):
    dammy.append((A*x)//B - A * int(x/B))
    x = x -1
print(max(dammy))


### FIXED CODE ###

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

W = N//B
dammy=[]
x=N
dammy.append((A*x)//B - A * int(x/B))
x=(B * W)-1
dammy.append((A*x)//B - A * int(x/B))


print(max(dammy))
### BUGGY CODE ###

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

l, r = map(int, input().split())
ID = list(range(l, r + 1))
for _ in range(m - 1):
    l, r = map(int, input().split())
    if r < min(ID):
        print(0)
        exit()
    elif max(ID) < l:
        print(0)
        exit()
    elif min(ID) >= l and max(ID) >= r:
        l = min(ID)
        ID.clear()
        ID.extend(range(l, r + 1))
    elif min(ID) < l and max(ID) >= r:
        ID.clear()
        ID.extend(range(l, r + 1))
    elif min(ID) < l and max(ID) < r:
        r = max(ID)
        ID.clear()
        ID.extend(range(l, r + 1))

print(len(ID))


### FIXED CODE ###

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

l, r = map(int, input().split())
for _ in range(m - 1):
    li, ri = map(int, input().split())
    if ri < l:
        print(0)
        exit()
    elif r < li:
        print(0)
        exit()
    elif l >= li and r >= ri:
        r = ri
    elif l < li and r >= ri:
        l, r = li, ri
    elif l < li and r < ri:
        l = li

print(r - l + 1)
### BUGGY CODE ###

import sys
from heapq import heappop, heappush
input = sys.stdin.readline
 
def main():
    n,w,l = map(int,input().split())
    g = [[] for _ in range(n)]
    for _ in range(w):
        x,y,z = map(int,input().split())
        x -= 1
        y -= 1
        if z > l:
            continue
        g[x].append((y,z))
        g[y].append((x,z))
    q = int(input())
    st = []
    for _ in range(q):
        s,t = map(int,input().split())
        s -= 1
        t -= 1
        st.append((s,t))
    d = [[] for _ in range(n)]
    for i in range(n):
        que = []
        dd = [10**15 for _ in range(n)]
        dd[i] = 0
        heappush( que,(0,i) )
        while que:
            p = heappop(que)
            v = p[1]
            if dd[v] < p[0]:
                continue
            for j in range(len(g[v])):
                edge = g[v][j]
                if dd[edge[0]] > dd[v] + edge[1]:
                    dd[edge[0]] = dd[v] + edge[1]
                    heappush( que,(dd[edge[0]] , edge[0]) )
        d[i] = dd
    G = [[10**15 for _ in range(n)] for _ in range(n)]
    for i in range(n-1):
        for j in range(i+1,n):
            if d[i][j] <= l:
                G[i][j] = 1
                G[j][i] = 1
    for i in range(n):
        G[i][i] = 0
    for k in range(n):
        for i in range(n):
            for j in range(n):
                G[i][j] = min(G[i][j],G[i][k] + G[k][j])
    for i in range(q):
        [s,t] = st[i]
        ans = G[s][t]
        if ans == 10**15:
            print(-1)
            continue
        print(ans-1)
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
from heapq import heappop, heappush
from scipy.sparse.csgraph import floyd_warshall
input = sys.stdin.readline
 
def main():
    n,w,l = map(int,input().split())
    d = [[10**15 for _ in range(n)] for _ in range(n)]
    for _ in range(w):
        x,y,z = map(int,input().split())
        x -= 1
        y -= 1
        if z > l:
            continue
        d[x][y] = z
        d[y][x] = z
    for i in range(n):
        d[i][i] = 0
    d = floyd_warshall(d)
    G = [[10**15 for _ in range(n)] for _ in range(n)]
    for i in range(n-1):
        for j in range(i+1,n):
            if d[i][j] <= l:
                G[i][j] = 1
                G[j][i] = 1
    for i in range(n):
        G[i][i] = 0
    G = floyd_warshall(G)
    q = int(input())
    for _ in range(q):
        s,t = map(int,input().split())
        s -= 1
        t -= 1
        ans = G[s][t]
        if ans == 10**15:
            print(-1)
            continue
        print(int(ans)-1)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

n = int(input())
 
spot = list(map(int, input().split()))
 
for i in range(n):
    total = 0
 
    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - spot[l]
            pos = spot[l]
            
            if money < 0:
                money *= -1
            total += money
 
    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

### FIXED CODE ###

from collections import deque

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

A.append(0)
A.appendleft(0)

A_diff = [abs(A[i+1] - A[i]) for i in range(N+1)]
A_sum = sum(A_diff)

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))
### BUGGY CODE ###

N,M=map(int,input().split())
tree=[[] for _ in range(N)]
for _ in range(M):
    u,v=map(int,input().split())
    tree[u-1].append(v-1)
S,T=map(int,input().split())
s=S-1
t=T-1
ischecked=[[0]*3 for _ in range(N)]
ischecked[s][0]=1
ans=-1
q=[]
q.append([s,0])
while q:
    v,c=q.pop(0)
    if v==t and c%3==0:
        ans=c//3
        break
    for i in tree[v]:
        if ischecked[i][(c+1)%3]==0:
            q.append([i,c+1])
            ischecked[i][(c+1)%3]==1
print(ans)

### FIXED CODE ###

import collections
N,M=map(int,input().split())
tree=[[] for _ in range(N)]
for _ in range(M):
    u,v=map(int,input().split())
    tree[u-1].append(v-1)
S,T=map(int,input().split())
s=S-1
t=T-1
ischecked=[[0]*3 for _ in range(N)]
ischecked[s][0]=1
ans=-1
q=collections.deque()
q.append([s,0])
while q:
    v,c=q.popleft()
    if v==t and c%3==0:
        ans=c//3
        break
    for i in tree[v]:
        if ischecked[i][(c+1)%3]==0:
            q.append([i,c+1])
            ischecked[i][(c+1)%3]=1
print(ans)
### BUGGY CODE ###

# D - Lucky PIN
import itertools

N = int(input())
S = str(input())

# 文字列Sから3文字選ぶ組み合わせを数え上げるとTLE
# 暗証番号の組み合わせが高々1,000通りしかないので、
# それごとに条件に該当するかをチェックしてカウントする。
ans = 0
for i, j, k in itertools.product(range(10),repeat=3):
    # i, j, kの組み合わせが起き得るか
    chk = str(i)+str(j)+str(k)
    idx = 0
    for s in S:
        if s==chk[idx]:
            idx += 1
            if idx == 3:
                ans += 1
                break
print(ans)


### FIXED CODE ###

# D - Lucky PIN

N = int(input())
S = str(input())

# 文字列Sから3文字選ぶ組み合わせを数え上げるとTLE
# 暗証番号の組み合わせが高々1,000通りしかないので、
# それごとに条件に該当するかをチェックしてカウントする。
ans = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            # i, j, kの組み合わせが起き得るか
            chk = str(i)+str(j)+str(k)
            idx = 0
            for s in S:
                if s==chk[idx]:
                    idx += 1
                    if idx == 3:
                        ans += 1
                        break
print(ans)
### BUGGY CODE ###

from collections import Counter
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)

CNT = Counter(l)
cnt = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        temp0 = l[j] - l[i]
        temp1 = l[j] + l[i]
        for k in range(l[j] + 1, temp1):
            #print(k,CNT[k])
            cnt += CNT[k]
            if k == l[j]:cnt += -1
            if k == l[i]:cnt += -1
print(cnt)
#print(CNT)

### FIXED CODE ###

#ABC143-D
n=int(input())
l=list(map(int,input().split()))
l=sorted(l,reverse=True)
ans=0
#print(l)
for i in range(n-2):
    for j in range(i+1,n-1):
        b=l[i]
        c=l[j]

        #二分探索
        ok=j
        ng=n
        while ng-ok>1:
            mid=(ok+ng)//2
            if l[mid]>b-c:
                #b>=cはわかってる
                ok=mid

            else:
                ng=mid

        ans+=ok-j
print(ans)
### BUGGY CODE ###

N,M = [int(i) for i in input().split()]
L=[]
R=[]
for n in range(M):
    temp = [int(i) for i in input().split()]
    L.append(temp[0])
    R.append(temp[1])
init_set = set(range(L[0],R[0]+1))
for n in range(M-1):
    now_set = set(range(L[n+1],R[n+1]+1))
    init_set = (init_set & now_set)
print(len(init_set))

### FIXED CODE ###

N,M = [int(i) for i in input().split()]
L_max ,R_min = [int(i) for i in input().split()]
for _ in range(M-1):
    temp = [int(i) for i in input().split()]
    if L_max < temp[0]:
        L_max = temp[0]
    if R_min > temp[1]:
        R_min = temp[1]
print(max(R_min - L_max + 1,0))
### BUGGY CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
MOD=10**9+7
comb=[0]*(N)
comb[K-1]=1
ans=0
for i in range(K,N):
    comb[i]=comb[i-1]*i//(i-(K-1))
for i in range(N-K+1):
    ans=ans+comb[N-1-i]*(A[N-1-i]-A[i])
    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 ###

import heapq

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

l = []
for _ in range(N):
    tmp = list(map(int, input().split()))
    if tmp[0] <= M:
        l.append(tmp)

l.sort()
ans = 0
a = []
for i in range(1, M+1):
    for j in l:
        if j[0] == i:
            heapq.heappush(a, -j[1])
        elif j[0] > i:
            break
    if len(a) != 0:
        ans -= heapq.heappop(a)

print(ans)

### FIXED CODE ###

from heapq import heappop, heappush
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
X = sorted([list(map(int, input().split())) for _ in range(N)], key = lambda x: x[0])

hq = []
ans, j = 0, 0

for i in range(1, M + 1):  # M - i 日後にするバイトを考える
    while (j < N) and (X[j][0] <= i):
        heappush(hq, -X[j][1])  # 候補の追加
        j += 1
    if len(hq):
        ans += -heappop(hq)  # 候補があるとき、候補から最大値を取り出す

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

k=int(input())
import fractions
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=fractions.gcd(i,j)
      c=fractions.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif (i!=j and j==k) or (k!=i and i==j):
        x+=3*c
      else:
        x+=c
print(x)

### FIXED CODE ###

k=int(input())
import math
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=math.gcd(i,j)
      c=math.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif i==j==k:
        x+=c
      else:
        x+=3*c
print(x)
### BUGGY CODE ###

N,K,Q = map(int, raw_input().split())
A = []
 
for i in range(0,Q):
  A.append(int(raw_input()))
B = K-Q
for i in range(1,N+1):
  con = A.count(i)
  if (B + con) > 0:
    print "Yes"
  else:
    print "No"

### FIXED CODE ###

N,K,Q = map(int, raw_input().split())
K_list = [Q-K]*N
for i in range(0,Q):
  index = int(raw_input())
  K_list[index-1] = K_list[index-1] -1

for i in K_list:
  if i < 0:
    print "Yes"
  else:
    print "No"
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9)
N = input()
S = input().strip()
type = len(set(S))

def DP(i,s):
  # 葉チェック
  if i >= len(S):
    return 1 if len(s) > 0 else 0
  if len(s) >= type:
    return 1
  if i+1 == len(S):
    adopt = 1 if S[i] not in s else 0
    me = 1 if len(s) > 0 else 0
    return adopt + me
  
  # S[i]を採用しない枝
  notadopt = DP(i+1, s)
  
  # S[i]を採用する枝
  if S[i] not in s:
    s += S[i]
    adopt = DP(i+1, s)
  else:
    adopt = 0

  return adopt + notadopt

print(DP(0, '')%(10**9+7))


### FIXED CODE ###

from collections import Counter
input()
S = input().strip()
c = Counter(S)
ans = 1
for k,v in c.items():
  ans *= (v+1)
print((ans-1)%(10**9+7))
### BUGGY CODE ###

import numpy as np

n = int(input())
p = np.array(list(int(x) for x in input().split()))
sum = 1

for i in range(1, n):
    if(np.all(p[:i] > p[i])):
        sum += 1

print(sum)


### FIXED CODE ###

import numpy as np

n = int(input())
p = np.array(list(int(x) for x in input().split()))
sum = 0
low = p[0] + 1

for i in p:
    if(i < low):
        sum += 1
        low = i

print(sum)
### BUGGY CODE ###

n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2]  < abs(x-now[0]) + abs(y-now[1]):
        del now
      else:
        cnt += 1
  step += 1
print(' '.join(list(map(str,can[0]))))

### FIXED CODE ###

n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] > abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  step += 1
print(' '.join(list(map(str,can[0]))))
### BUGGY CODE ###

import bisect
N = int(input())
A = list(map(int, input().split()))
B = sorted(list(map(int, input().split())))
l_b = len(B)
C = sorted(list(map(int, input().split())))
l_c = len(C)
ans = 0
for a in A:
    i = bisect.bisect_right(B, a)
    for j in range(i, l_b):
        num = bisect.bisect_right(C, B[j])
        ans += l_c - num
print(ans)


### FIXED CODE ###

import bisect
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
l_c = len(C)
ans = 0
for b in B:
    n_a = bisect.bisect_left(A, b)
    n_c = l_c - bisect.bisect_right(C, b)
    ans += n_a*n_c
print(ans)
### BUGGY CODE ###

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

temp = 1
for i in range(K):
    temp *= A[i]
flag = 1
for i in range(K, N):
    temp2 = temp
    temp *= A[i]
    temp //= A[i-K]
    if temp2 >= temp:
        print("No")
    else:
        print("Yes")



### FIXED CODE ###

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

temp = 1
# for i in range(K):
#     temp *= A[i]
# flag = 1
for i in range(K, N):
    # temp2 = temp
    # temp *= A[i]
    # temp //= A[i-K]
    if A[i] <= A[i-K]:
        print("No")
    else:
        print("Yes")