Harryxun/stf_run huggingface dataset:
N, Y = map(int, input().split())
# x:10000円, y;5000円, z:1000円
for x in range(N+1):
    for y in range(N-x+1):　# 5000円の枚数をN-(10000円の枚数)までに制限
        z = N - (x + y)
        if 10000*x + 5000*y + 1000*z == Y:
            print(x, y, z)
            exit(0)
print(-1, -1, -1)

### FIXED CODE ###

N, Y = map(int, input().split())
flg = False
for x in range(N+1):
    for y in range(N+1):
        if ((10000*x + 5000*y + (N-x-y)*1000)==Y) & (x+y<=N):
            print(x,y,(N-x-y))
            flg = True
            break
    if flg:
        break
else:
    print(-1,-1,-1)
n = int(input())
array = [int(input()) for i in range(n)]
def shift_only(array):
    tmp = []
    counter = 0
    while True:
        flag = True
        # 全て偶数かを確認
        for num in array:
            if num%2 != 0:
                flag = False
        if flag == False:
            break
        array = [i/2 for i in array]
        counter +=1
    print(counter)

### FIXED CODE ###

def shift_only(array):
    tmp = []
    counter = 0
    while True:
        flag = True
        # 全て偶数かを確認
        for num in array:
            if num%2 != 0:
                flag = False
        if flag == False:
            break
        array = [i/2 for i in array]
        counter +=1
    print(counter)
    
n = int(input())
a = list(map(int, input().split()))
shift_only(a)
x, y = map(int, input().split())
list1 = [1,3,5,6,8,10,12,4,6,9,11,2]
list2 = [0,0,0,0,0,0,0,1,1,1,1,2]
d = dict(zip(list1, list2))
if d[x] == d[y]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x, y = map(int, input().split())
list1 = [1,3,5,7,8,10,12,4,6,9,11,2]
list2 = [0,0,0,0,0,0,0,1,1,1,1,2]
d = dict(zip(list1, list2))
if d[x] == d[y]:
  print("Yes")
else:
  print("No")
A,B=input().split()
A=int(A)
B=round(100*B)
print(A*B%100)

### FIXED CODE ###

A,B=input().split()
A=int(A)
B=round(100*float(B))
print(A*B//100)
N = int(input())
L = []
for i in range(N):
  A = int(input())
  for j in range(A):
    x ,  y= map(int,input().split())
    L.append([i+1,x,y])

from itertools import permutations, combinations,combinations_with_replacement,product
LL = list(product(range(2), repeat=N))

cnt = 0
for i in LL:
  ii = list(i)
  Ans =[]
  for j in L:
    if j[2]==1 and ii[j[0]-1]==1:
      k = 1
    elif j[2]==1 and ii[j[0]-1]==0:
      k = 0
    elif j[2]==0 and ii[j[0]-1]==1:
      k = 0
    elif j[2]==0 and ii[j[0]-1]==0:
      k = 1
    Ans.append([j[1],k])
  Ans.sort()
  for l in range(len(Ans)):
    if i[Ans[l][0]-1] != Ans[l][1]:
      flg = 0
      break
    else:
      flg = 1
#  print(i,flg,Ans)
  cnt = max(cnt,sum(i)*flg)
print(cnt)

### FIXED CODE ###

N = int(input())
L = []
for i in range(N):
  A = int(input())
  LA = []
  for j in range(A):
    LA.append(list(map(int,input().split())))
  L.append(LA)
from itertools import product
LL = list(product(range(2), repeat=N))
cnt = 0
for i in LL:
  flg = True
  for j in range(len(L)):
    #jの情報は、(hito=x, singi = y=1,0)
    #iの情報は、(singi = (1/0,...,1/0))
    for x,y in L[j]:
      #jさんの情報      
      #i[j] :sinngi　正解
      #y:sinngi　を変換
      if i[j]==1:
        if i[x-1]!=y:
          flg = False
          break
  if flg:
    cnt = max(cnt,sum(i))
print(cnt)
x = int(input())

for i in range(200):
    for j in range(-200, 0):
        if i ** 5 - j ** 5 == x:
            a=i
            b=j

print(a, b)

### FIXED CODE ###

x = int(input())

for i in range(200):
    for j in range(-200, 200):
        if i ** 5 - j ** 5 == x:
            a=i
            b=j

print(a, b)
import sys
input = sys.stdin.readline

h1, m1, h2, m2, k = input.split()

h_time = (h2 - h1 -1) * 60
m_time = (60 - m1) + m2

rest_time = (h_time + m_time) - k
print(rest_time)

### FIXED CODE ###

import sys
input = sys.stdin.readline

h1, m1, h2, m2, k = map(int, input().split())

h_time = (h2 - h1 -1) * 60
m_time = (60 - m1) + m2

rest_time = (h_time + m_time) - k
print(rest_time)
import numpy as np

p = np.zeros((14,14), dtype=int)
while True:
    try:
        x_inp, y_inp, s = map(int, input().split(","))
        x = x_inp + 2
        y = y_inp + 2
        if s == 1:
            p[y-1][x] += 1
            p[y][x-1:x+2] += 1
            p[y+1][x] += 1
        elif s == 2:
            p[y-1][x-1:x+2] += 1
            p[y][x-1:x+2] += 1
            p[y+1][x-1:x+2] += 1
        else:
            p[y-2][x] += 1
            p[y-1][x-1:x+2] += 1
            p[y][x-2:x+3] += 1
            p[y+1][x-1:x+2] += 1
            p[y+2][x] += 1
    except:
        break
p_trim = p[2:12,2:12]
print(len(np.where(p_trim==0)[0]))
print(np.max(p_trim))



### FIXED CODE ###

p = [[0 for i in range(14)] for j in range(14)]
while True:
    try:
        x_inp, y_inp, s = map(int, input().split(","))
        x = x_inp + 2
        y = y_inp + 2
        if s == 1:
            p[y-1][x] = p[y-1][x] + 1
            p[y][x-1] = p[y][x-1] + 1
            p[y][x]   = p[y][x]   + 1
            p[y][x+1] = p[y][x+1] + 1
            p[y+1][x] = p[y+1][x] + 1
        elif s == 2:
            p[y-1][x-1] = p[y-1][x-1] + 1
            p[y-1][x]   = p[y-1][x]   + 1
            p[y-1][x+1] = p[y-1][x+1] + 1
            p[y][x-1]   = p[y][x-1]   + 1
            p[y][x]     = p[y][x]     + 1
            p[y][x+1]   = p[y][x+1]   + 1
            p[y+1][x-1] = p[y+1][x-1] + 1
            p[y+1][x]   = p[y+1][x]   + 1
            p[y+1][x+1] = p[y+1][x+1] + 1
        else:
            p[y-2][x] += 1
            p[y-1][x-1] = p[y-1][x-1] + 1
            p[y-1][x]   = p[y-1][x]   + 1
            p[y-1][x+1] = p[y-1][x+1] + 1
            p[y][x-2]   = p[y][x-2]   + 1
            p[y][x-1]   = p[y][x-1]   + 1
            p[y][x]     = p[y][x]     + 1
            p[y][x+1]   = p[y][x+1]   + 1
            p[y][x+2]   = p[y][x+2]   + 1
            p[y+1][x-1] = p[y+1][x-1] + 1
            p[y+1][x]   = p[y+1][x]   + 1
            p[y+1][x+1] = p[y+1][x+1] + 1
            p[y+2][x] += 1
    except:
        break
p_trim = [p[i][2:12] for i in range(2,12)]
p_flatten = sum(p_trim,[])
print(sum(x==0 for x in p_flatten))
print(max(p_flatten))
N, Q = map(int, input().split())
S = str(input())

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count

for item in q_list:
    l, r = item[0], item[1]
    print(ac_list[r - 1] - ac_list[l - 1])

### FIXED CODE ###

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

q_list = [0] * Q

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count

for item in q_list:
    l, r = item[0], item[1]

    print(ac_list[r - 1] - ac_list[l - 1])
A = list(int, input().split())
print(A.index('0') + 1)

### FIXED CODE ###

l = list(map(int,input().split()))
print (l.index(0)+1)
import math
N, Q = map(int, input().split())
S = str(input())

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count
#print(ac_list)
for item in q_list:
    l, r = item[0], item[1]

    print(ac_list[r - 1] - ac_list[l - 1])

### FIXED CODE ###

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

q_list = [0] * Q

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count

for item in q_list:
    l, r = item[0], item[1]

    print(ac_list[r - 1] - ac_list[l - 1])
import math 
print(math.ceil(int((int(input())+int(input()))/2))

### FIXED CODE ###

import math 
a,b = map(int,input().split())
print(math.ceil((a+b)/2))
import collections
n = int(input())
alist = list(map(int,input().split()))
adic = collections.Counter(alist)
for k,v in adic.items():
  if v == 1:
    del(adic[k])
sort_adic = sorted(adic.items(), reverse = True, key = lamda x:x[1])
li = list(sort_adic.items())
print(li[0][1]*li[1][1])

### FIXED CODE ###

import collections
n = int(input())
alist = list(map(int,input().split()))
adic = collections.Counter(alist)
A = [0,0]
for i in adic:
  if adic[i] > 1:
    A.append(i)
  if adic[i] > 3:
    A.append(i)
sortedA = sorted(A)
print(sortedA[-1]*sortedA[-2])
N, K = map(int, input().split())
A = list(map(int, input().split()))

def f(x):
    ret = 0
    for a in A:
        ret += a//x
    return ret

if K == 0:
    print(max(A))
    exit()
ok = -1
ng = 10**9 + 1
while ng - ok > 1:
    mid = (ok + ng) // 2
    if f(mid) <= K:
        ng = mid
    else:
        ok = mid
print(ng)

### FIXED CODE ###

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

def f(x):
    return sum((a+x-1)//x - 1 for a in A)

l = 0
r = 10**9+1 
while r - l > 1:
    mid = (l + r) // 2
    if f(mid) <= K:
        r = mid
    else:
        l = mid
print(r)
N,K = map(int,input().split())

d = int(input())
ans = [0 for i in range(N)]

for i in range(d):
  List=list(map(int,input().split()))
  for j in List:
    ans[j-1] += 1
    
print(ans.count(0))

### FIXED CODE ###

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

ans = [0 for i in range(N)]

for i in range(K):
  d = int(input())
  List=list(map(int,input().split()))
  for j in List:
    ans[j-1] += 1
    
cnt = 0

for i in ans:
  if i == 0:
    cnt += 1
    
print(cnt)
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]
if n == 1:
  start,end = 0,9
elif n == 2:
  start,end = 10,99
else:
  start,end = 100, 999

for i in range(start, end+1):
  flg = True
  for j in l:
    si = str(i)
    if len(si) < j[0]:
      flg = False
      continue

    if si[j[0]-1] != str(j[1]):
      flg = False
      
  if flg == True:
    print(i)
    break
else:
  print(-1)


### FIXED CODE ###

i=int(input())
print(int(i/2) if i%2==0 else int(i//2)+1)
import numpy as np

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

connect = np.zeros((n,n))

for i in range(m):
    a, b = map(int, input().split())
    connect[a-1, b-1] = 1
    connect[b-1, a-1] = 1

notbridge = 0


for i in range(n):
    for j in range(n):
        if connect[i,j] == 1:
            connect[i,j] = 0
            connect[j,i] = 0
            stack =[1]
            visited = [1]
            while stack:
                p = stack.pop()
                for k in range(n):
                    if connect[p,k] == 1:
                        if k not in visited:
                            stack.append(k)
                            visited.append(k)
            if len(visited) == n:
                notbridge += 1
            connect[i,j] = 1
            connect[j,i] = 1



print(m-notbridge//2)




### FIXED CODE ###

import numpy as np

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

connect = np.zeros((n,n))

for i in range(m):
    a, b = map(int, input().split())
    connect[a-1, b-1] = 1
    connect[b-1, a-1] = 1

notbridge = 0


for i in range(n):
    for j in range(n):
        if connect[i,j] == 1:
            connect[i,j] = 0
            connect[j,i] = 0
            stack =[1]
            visited = [1]
            while stack:
                p = stack.pop()
                for k in range(n):
                    if connect[p,k] == 1:
                        if k not in visited:
                            stack.append(k)
                            visited.append(k)
            if len(visited) == n:
                notbridge += 1
            connect[i,j] = 1
            connect[j,i] = 1



print(m-notbridge//2)
a,b,c=int(input())
if a==b and a!=c:
  print("Yes")
elif b==c and b!=a:
  print("Yes")
elif c==a and c!=b:
  print("Yes")
else:
  print("No")
  


### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b and a!=c:
  print("Yes")
elif b==c and b!=a:
  print("Yes")
elif c==a and c!=b:
  print("Yes")
else:
  print("No")
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
AK = np.array(read().split(),np.int32)

A = AK[::2]; K = AK[1::2]

G = 0

for t in range(50000):
    q = A//K; r = A%K
    q += 1
    r += (-r)%q
    A -= r
    if t%1000==0:
        ind = r!=0
        G ^= np.bitwise_xor.reduce(A[~ind]//K[~ind])
        A=A[ind];K=K[ind]
        if len(A)==0:
            break

answer = 'Takahashi' if G else 'Aoki'
print(answer)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
AK = np.array(read().split(),np.int32)

A = AK[::2]; K = AK[1::2]

for _ in range(50000):
    q = A//K; r = A%K
    q += 1
    r += (-r)%q
    A -= r

A //= K #grundy
g = np.bitwise_xor.reduce(A)

answer = 'Takahashi' if g else 'Aoki'
print(answer)
n, k = map(int, input().split())
lst = list(map(int, (input().split())))
lst = [_ - 1 for _ in lst]

visited = [0] * n
flg = 1
i = 0
now = 0
while flg:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break
        
k_bk = k - visited[now]
k_bk =  k_bk // (i - visited[now])

lft = k - k_bk * (i - visited[now])

if lft ==0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)

### FIXED CODE ###

n, k = map(int, input().split())
lst = list(map(int, (input().split())))
lst = [_ - 1 for _ in lst]

visited = [0] * n
i = 0
now = 0
while k > i:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break

lp = (i + 1) - visited[now]
st = i - lp
k_bk = k - st
k_bk = k_bk // lp
lft = k - (k_bk * lp + st)

if lft == 0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)
def main():
    n, k = (int(i) for i in input().split())
    a = [int(i) for i in input().split()]
    a.sort()
    diff_min = a[-1] - a[-2]
    l_diff = set()
    for i in range(n-1):
        diff = abs(a[i] - a[i+1])
        diff_min = (min(diff_min,diff) if diff != 0 else diff_min)
        l_diff.add(diff_min)
    for i in range(n):
        diff_min = (a[i] % diff_min if a[i] % (diff_min) != 0 else diff_min)
    a.extend(l_diff)
    n = len(a)
    for i in range(n):
        if a[i] - k >= 0 and (a[i] - k)%diff_min == 0:
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n, k = (int(i) for i in input().split())
    a = [int(i) for i in input().split()]
    a.sort()
    diff_min = 10**9 + 7
    for i in range(n-1):
        diff = abs(a[i] - a[i+1])
        diff_min = (min(diff_min,diff) if diff != 0 else diff_min)
    for i in range(n):
        diff_min = (a[i] % diff_min if a[i] % (diff_min) != 0 else diff_min)
    for i in range(n):
        if a[i] - k >= 0 and (a[i] - k)%diff_min == 0:
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")
if __name__ == '__main__':
    main()
S = input()
def div(strings):
    if len(strings) == 0:
        return 0
    elif len(strings) == 1:
        return 1
    elif len(strings) == 2:
        if S[0] == S[1]:
            return 1
        else:
            return 2
    elif strings[len(strings)-1] != strings[len(strings)-2]:
        return div(strings[0:len(strings)-1]) + 1
    else:
        return div(strings[0:len(strings)-3]) + 2
if len(S) == 1:
    print(1)
elif len(S) == 2:
    if S[0] == S[1]:
        print(1)
    else:
        print(2)
else:
    print(div(S))

### FIXED CODE ###

S = input()
count = 1
i = 0
initial_length = len(S)-1
l = S[0]
S = S + '&' + '%'
while i < initial_length:
    if l == S[i+1]:
        if i == initial_length-1:
            break
        elif S[i+2] == S[i+3]:
            l = S[i+3]
            i += 3
            count += 1
        else:
            l = S[i+1:i+3]
            i += 2
    else:
        l = S[i+1]
        i += 1
    count += 1
print(count)
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines()]
  n = lines[0]
  for i in range(n):
    # a, b  = int(lines[i+1]), int(lines[i+2])
    a, b  = lines[2*i+1], lines[2*i+2]
    print a+b

### FIXED CODE ###

import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '' and x != '\n']
  n = lines[0]
for i in xrange(n):
  a, b  = lines[2*i+1], lines[2*i+2]
  if len(str(a+b)) > 80:
    print 'overflow'
  else:
    print a+b
import sys

T = input()
for i in range(0,T):
    K,P = raw_input().split(' ')
    K = int(K)
    P = int(P)
    print ( K % P - 1 + P ) % P + 1

### FIXED CODE ###

import sys

T = input()
for i in range(0,T):
    K,P = raw_input().split(' ')
    K = int(K)
    P = int(P)
    print ( K % P - 1 + P ) % P + 1
N = int(input())

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

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


myans = 0
mymin = 9999999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)

### FIXED CODE ###

N = int(input())


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


myans = 0
mymin = 9999999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)
n = int(input())
list1 = [int(x) for x in input().split()]

set1 = set(list1)


listans = []

for i in set1:
  if list1.count(i) > 1 and list1.count(i) < 4:
    listans.append(i)
  elif list1.count(i) >3:
    listans.append(i)
    listans.append(i)




listasn = sorted(listans)
if len(listansn) < 2:
  print(0)
else:
  print(listansn[-1]*listansn[-2])

### FIXED CODE ###

n = int(input())
list1 = [int(x) for x in input().split()]
list2 = list(reversed(sorted(list1)))

fflag = 0
ans = []
for i in range(len(list2) - 1):
  if fflag ==0:
    if list2[i] == list2[i + 1]:
      ans.append(list2[i])
      fflag = 1
  elif fflag == 1:
    fflag = 0
    continue
  if len(ans) == 2:
    break

if len(ans) == 2:
  print(ans[0] * ans[1])
else:
  print(0)
n = int(input())
from operator import itemgetter
a=[]
for i in range(n):
  a.append(tuple(map(str,input().split()),i))
a1= sorted(a,key=itemgetter(0))
a2=sorted(a1,key=itemgetter(1),reverse=True)
for i in range(n):
  print(a2[i][2])

### FIXED CODE ###

n = int(input())
from operator import itemgetter
a=[]
for i in range(n):
  b,c=map(str,input().split())
  c=int(c)
  a.append([b,c,i])
a1= sorted(a,key=itemgetter(1),reverse=True)
a2=sorted(a1,key=itemgetter(0))
for i in range(n):
  print((a2[i][2]+1))
n = int(input())
A = list(map(int,input().split()))
l = [[0,0],[0,0],[0,0]]
flag = 0
for i in range(n):
  x = A[i]
  for j in range(3):
    if l[j] == [0,0]:
      l[j] = [x,1]
      break
    if x == l[j][0]:
      l[j][1] += 1
      break
  else:
    break
a = l[0][1]
b = l[1][1]
c = l[2][1]
aa = l[0][0]
bb = l[1][0]
cc = l[2][0]
if n % 3 == 0:
  m = n // 3
  if a == m:
    if b == m and c == m:
      if aa ^ bb ^ cc == 0:
        flag = 1
  if a == 2 * m and b == m:
    if bb == 0:
      flag = 1
  if a == m and b == 2 * m:
    if aa == 0:
      flag = 1
else:
  if a == n and aa == 0:
    flag = 1
if a == 2 * m:
  print('Yes')

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n):
  s ^= a[i]
if s == 0:
  print('Yes')
else:
  print('No')
a, b, c, d = map(int().input())
if abs(a-c) <= d or (abs(a-b)<= d and abs(b-c)<=d):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if abs(a-c) <= d or (abs(a-b)<= d and abs(b-c)<=d):
  print("Yes")
else:
  print("No")
moji_s=input("文字列Sを入力:")
moji_t=input("文字列Tを入力:")
print(moji_s + moji_t)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
S,T = read().decode('utf-8').split()
 
answer = T + S
print(answer)
a, b, x = map(int, input().split())

sum_number = []

for i in range(x+1):
  if a< sum(map(int, str(i))) < b:
    sum_number += [i]
    
priny(sum(sum_number))
  
  

### FIXED CODE ###

x, a, b,  = map(int, input().split())

sum_number = []

for i in range(x+1):
  if a <= sum(map(int, str(i))) <= b:
    sum_number += [i]
    
print(sum(sum_number))
n = int(input())
num = list(map(int,input().split()))
numabs = [abs(i) for i in num]
cnt = 0    
negative = []        
for i in num :
    if i < 0 :
        cnt += 1
        negtive.append()

if cnt % 2 == 0 :
    print(sum(numabs))

if cnt % 2 == 1 :
    print(sum(numabs)-2*max(negative))

### FIXED CODE ###

n = int(input())
num = list(map(int,input().split()))
numabs = [abs(i) for i in num]
cnt = 0           
for i in num :
    if i < 0 :
        cnt += 1

if cnt % 2 == 0 :
    print(sum(numabs))

if cnt % 2 == 1 :
    print(sum(numabs) - 2*min(numabs))
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sa = sum(a)
sb = sum(b)
counta = 0
countb = 0
for i,j in zip(a,b):
    if j > i:
        if j%i:
            countb += 1
        counta += (j-i+1)//2
    elif i > j:
        countb += i-j
if counta <= sb-sa and countb <= sb-sa:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sa = sum(a)
sb = sum(b)
counta = 0
countb = 0
for i,j in zip(a,b):
    if j > i:
        if (j-i)%2:
            countb += 1
        counta += (j-i+1)//2
    elif i > j:
        countb += i-j
if counta <= sb-sa and countb <= sb-sa:
    print("Yes")
else:
    print("No")
n = input()
n = int(n)

val_list = input().split()
answer = 0
for i, val in enumerate(val_list):
    if i == 0:
        answer = int(val)
    else:
        answer = answer * int(val)

if answer > 10**18:
    print(-1)
else:
    print(answer)


### FIXED CODE ###

a, b = input().split()
a = int(a)
b = int(b)

print(a * b)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A_count = [0] * len(A)
B_count = [0] * len(B)
for i in range(len(B)):
    B_count[i] = len(C) - bisect(C, B[i])
for i in range(len(A)):
    A_count[i] = sum(B_count[bisect(B, A[i]):])
print(sum(A_count))

### FIXED CODE ###

import sys
import bisect

def main():
    input = sys.stdin.buffer.readline
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    B = list(map(int, input().split()))
    B.sort()
    C = list(map(int, input().split()))
    C.sort()
    ans = 0
    for i in B:
        a = bisect.bisect_left(A, i)
        c = bisect.bisect_right(C, i)
        ans += a*(N-c)
    print(ans)

if __name__ == '__main__':
    main()
n = int(input)
count = 0
ans = 'No'
for i in range(n):
    a , b = map(int,input().split(' '))
    if a!=b:
        count = 0 
    else:
        count += 1
    if count == 3:
        ans = 'Yes'
print(ans)  

### FIXED CODE ###

n = int(input())
count = 0
ans = 'No'
for i in range(n):
    a , b = map(int,input().split(' '))
    if a!=b:
        count = 0 
    else:
        count += 1
    if count == 3:
        ans = 'Yes'
print(ans)
mod = 10**9+7
N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
memo = [[-1]*(M+1) for _ in range(N)]
List = [[]for _ in range(N)]

for i in range(N):
    for j in range(M):
        if S[i]==T[j]:
            List[i].append(j)
def dp(i, j):
    if i==N-1:
        cnt = 0
        for k in List[i]:
            if j<k:
                cnt+=1
        return (cnt+1)%mod
    res = 0
    for k in List[i]:
        if j<k:
            if memo[i+1][k]<0:
                memo[i+1][k]=dp(i+1, k)
            res+=memo[i+1][k]
    if memo[i+1][j]<0:
        memo[i+1][j]=dp(i+1, j)
    res+=memo[i+1][j]
    return res%mod
print(dp(0, -1)%mod)


### FIXED CODE ###

mod = 10**9+7
N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [[0]*(M+1) for _ in range(N+1)]
dp[0][0] = 1
Sum = [[1]*(M+1) for _ in range(N+1)]
for i in range(1, N+1):
    for j in range(1, M+1):
        if S[i-1] == T[j-1]:
            dp[i][j] = Sum[i-1][j-1]%mod
        else:
            dp[i][j] = 0
        Sum[i][j] = (Sum[i-1][j]+Sum[i][j-1]-Sum[i-1][j-1]+dp[i][j])%mod
print(Sum[N][M]%mod)