Harryxun/stf_run huggingface dataset:
#G
N,M=map(int,input().split())
A=[[] for i in range(N+1)]
dp=[[] for j in range(N)]

for i in range(M):
    x,y=map(int,input().split())
    A[x].append(y)
    dp[1]=dp[1]+[y]

flag=False
for i in range(2,N):
    for x in dp[i-1]:
        dp[i]=dp[i]+A[x]
            
        if dp[i]==[]:
            flag=True
            result=i
            break
    if flag:
        break

print(result)

### FIXED CODE ###

#G
N,M=map(int,input().split())
A=[[] for i in range(N+1)]
B=[0 for i in range(N+1)]
dp=[0 for j in range(N+1)]

for i in range(M):
    x,y=map(int,input().split())
    A[x].append(y)
    B[y]+=1

st=[]
for i in range(1,N+1):
    if B[i]==0:
        st.append(i)
        dp[i]

while len(st):
    x=st.pop()
    for y in A[x]:
        dp[y]=max(dp[y],dp[x]+1)
        B[y]-=1
        if B[y]==0:
            st.append(y)
print(max(dp))
def chmin(a,b):
    if a > b:
        return b
    else:
        return a

N, W = map(int, input().split())
w = []
v = []
Vmax = 100 * N

for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

inf = float('inf')
dp = [[inf] * (Vmax+1) for _ in range(N)]
dp[0][0] = 0
dp[0][v[0]] = w[0]

for i in range(1,N):
    for j in range(Vmax):

        if dp[i-1][j] != inf:
            dp[i][j] = dp[i-1][j]

            if dp[i-1][j] + w[i] <= W:
                dp[i][j+v[i]] = chmin(dp[i][j+v[i]], dp[i-1][j] + w[i])
        
for j in range(Vmax):
    if dp[N-1][j] != inf:
        ans = j

print(ans)

### FIXED CODE ###

N,W=map(int,input().split())
w=[]
v=[]
for i in range(N):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
dp=[[10**22]*(N*(10**3)+1) for i in range(N+1)]
dp[0][0]=0
for i in range(1,N+1):
    for j in range(N*(10**3)+1):
        if j>=v[i-1]:
            dp[i][j]=min(dp[i-1][j-v[i-1]]+w[i-1],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
for i in range(N*(10**3),-1,-1):
    if dp[N][i]<=W:
        print(i)
        break
import numpy as np
from math import gcd
from functools import reduce

N, M = map(int,input().split())
a = list(map(int,input().split()))
a = np.array(a)
a = a // 2

def solve(p, q):
    cnt = 1
    while p % 2 == 0 and q % 2 == 0:
        cnt <<= 1
        p >>= 1
        q >>= 1
    if (p - q) % 2 != 0:
        return 0
    return p * q * cnt // gcd(p, q)
k = reduce(solve, a)
if k == 0:
    print(0)
else:
    ans = (M / k + 1) // 2
    print(ans)

### FIXED CODE ###

from fractions import gcd
from functools import reduce

N, M = map(int,input().split())
a = list(map(int,input().split()))
a = [x // 2 for x in a]

def solve(p, q):
    g = gcd(p, q)
    p //= g
    q //= g
    if (p - q) % 2 == 1:
        return 0
    return p * q * g

k = reduce(solve, a)
if k == 0:
    print(0)
else:
    print(M // k - M // (k * 2))
S = input()
flag = False
for s in S:
  if flag:
    if temp = s:
      print("Bad")
      quit()
  temp = s
  flag = True
print("Good")

### FIXED CODE ###

S = input()
flag = False
for s in S:
  if flag:
    if temp == s:
      print("Bad")
      quit()
  temp = s
  flag = True
print("Good")
S=input()
if(len(Sset)==2):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S=input()
Sset=set(S)
if(len(Sset)==2):
  print('Yes')
else:
  print('No')
def popcount(x):
    '''xの立っているビット数をカウントする関数
    (xは64bit整数)'''

    # 2bitごとの組に分け、立っているビット数を2bitで表現する
    x = x - ((x >> 1) & 0x5555555555555555)

    # 4bit整数に 上位2bit + 下位2bit を計算した値を入れる
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)

    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f # 8bitごと
    x = x + (x >> 8) # 16bitごと
    x = x + (x >> 16) # 32bitごと
    x = x + (x >> 32) # 64bitごと = 全部の合計
    return x & 0x0000007f


n=int(input())
x=input()
num=int(x,2)
cnt=popcount(num)
mod1,mod2=num%(cnt+1),num%(cnt-1)

for i in range(n):
    if x[i]=="0":
        ans=(mod1+pow(2,n-i-1,cnt+1))%(cnt+1)
    elif x[i]=="1" and cnt<=1:
        print(0)
        continue
    else:
        ans=(mod2-pow(2,n-i-1,cnt-1))%(cnt-1)
    point=1
    while ans!=0:
        ans %=popcount(ans)
        point +=1
    print(point)

### FIXED CODE ###

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


def popcnt(n):
    return bin(n).count("1")


def mod(n, cnt):
    if n == 0:
        return cnt
    n = n % popcnt(n)
    cnt += 1
    return mod(n, cnt)


n = int(readline())
x2 = list(readline().decode().rstrip())
x10 = int(''.join(x2), 2)

c = x2.count('1')
mod1 = x10 % (c + 1)
mod2 = x10 % (c - 1) if c - 1 != 0 else 0

for i in range(n):
    if x2[i] == '0':
        t = (mod1 + pow(2, n - i - 1, c + 1)) % (c + 1)
    else:
        if c - 1 != 0:
            t = (mod2 - pow(2, n - i - 1, c - 1)) % (c - 1)
        else:
            print(0)
            continue
    print(mod(t, 1))
A = int(input())
B = int(input())

print(A*B)

### FIXED CODE ###

A,B = input().split()
A = int(A)
B = int(B)
print(A*B)
n = input()
s = input()
i = input()
 
l = []
for i, c in enumerate(s):
  l.append(* if c != s[i-1] else c)
    
''.join(l)
 
print(l)

### FIXED CODE ###

n = input()
s = input()
i = int(input())
 
l = list(s)
for j, c in enumerate(l):
  if c != s[i-1]:
    l[j] = '*'
    
l = ''.join(l)
 
print(l)
N = int(input())

print(f'{(N+1)//2/N}')

### FIXED CODE ###

N = int(input())

print((N+1)//2/N)
a,b,c,d,e,f=map(int,input().split())
dp=[-1]*(f+1)
dp[0]=0
for i in range(f+1):
  for j in [a*100,b*100]:
    if dp[i-j]!=-1:
      dp[i]=max(0,dp[i])
  for j in [c,d]:
    if dp[i-j]!=-1 and 100*(dp[i-j]+j)<=e*(i-(dp[i-j]+j)):
      dp[i]=max(dp[i],dp[i-j]+j)
stack=0
index=0
for i in range(f+1):
  if dp[i]!=0:
    if stack<dp[i]*100//(i-dp[i]):
      stack=dp[i]*100//(i-dp[i])
      index=i
print(index,dp[index])

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
dp=[-1]*(f+1)
dp[0]=0
flag=True
for i in range(1,f+1):
  for j in [a*100,b*100]:
    if i-j>=0 and dp[i-j]!=-1:
      dp[i]=max(0,dp[i])
  for j in [c,d]:
    if i-j>=0 and dp[i-j]!=-1:
      if 100*(dp[i-j]+j)<=e*(i-(dp[i-j]+j)):
        dp[i]=max(dp[i],dp[i-j]+j)
      else:
        for k in [a*100,b*100]:
          if i-k-j>=0 and dp[i-k-j]!=-1:
            if 100*(dp[i-k-j]+j)<=e*(i-(dp[i-k-j]+j)):
              dp[i]=max(dp[i],dp[i-k-j]+j)
stack=0
index=min(a*100,b*100)
for i in range(index+1,f+1):
  if dp[i]>0:
    if stack<(dp[i]*100)/i:
      stack=(dp[i]*100)/i
      index=i
print(index,dp[index])
#関数f:入力xの1以外の約数をリストで出力
def f(x):
  out=set() #約数を保存するセット
  for i in range(1, (pow(x, 1/2)):
    #1-x**(1/2)未満の整数iについて、xを割り切れるか判定
    if x%i==0:
      #xをiで割り切れるのであれば、iとx/iを保存
      out.add(i)
      out.add(x//i)
      
  #x**(1/2)でxを割り切れる(つまりxが平方数)なら、出力にx**(1/2)を追加
  if x%(x**(1/2))==0:
    out.add(x**(1/2))
    
  #セットから昇順のリストに変換します
  out=list(out)
  out.sort()
  
  #昇順にした結果1が先頭に来ているため、インデックス1以降を出力
  return out[1:]

#入力受け取り
N=int(input())
ans=0 #最後に出力する変数

for K in f(N): #Nの1以外の約数について、操作の結果1になるかをそれぞれ調べる
    x=N #Nを直接書き換えると後に影響するため、ここではxとする
    #xをKで割り切れる間は、Kで割り続ける
    while x%K==0:
      x/=K
      
    #xをKで割り切れなくなったら、xからKを引けるだけ引く(=割って余りをとる)
    x%=K
    
    #操作後x=1となったならば、出力に1を足す
    if x==1:
        ans+=1
        
#(N-1)の1を除いた約数はすべて条件を満たすため、出力にf(N-1)の要素数を足す
ans+=len(f(N-1))

#出力
print(ans)

### FIXED CODE ###

N=int(input())
if N==2:
    print(1)
    exit()

ans=0
def f(x):
    out=set()
    for i in range(1, int(x**(1/2))+1):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    out=list(out)
    out.sort()
    return out[1:]

tmp=f(N)
for K in tmp:
    x=N
    while x>=K:
        if x%K==0:
            x=x//K
        else:
            x=x%K
            
    if x==1:
        ans+=1
        
tmp=f(N-1)
ans+=len(tmp)
print(ans)
w = int(input())
n = int(input())
nums = list(range(w + 1))
for _ in range(n):
    a, b = map(int, input().split(", "))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)

### FIXED CODE ###

w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = map(int, input().split(","))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)
p=int(input()),s=10**9
print(0,0,s,1,s-p%s,p//s)

### FIXED CODE ###

p=int(input());s=10**9
print(0,0,1,s,0--p//s,-p%s)
N=input()
s=input()
K=int(input())

t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(s))


### FIXED CODE ###

N=int(input())
s=list(input())
K=int(input())
t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(s))
S = input()
max = 0
for i in range(len(S)):
    if S[i] in 'ACGT':
        for j in range(i+1, len(S)):
            if S[j] not in 'ACGT':
                break
        max = (j - i) if max < (j - i) else max 
print(max)

### FIXED CODE ###

s = input()
z = ''
ans = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        ans = max(ans, 1)
        for j in range(i+1, len(s)):
            if s[j] in 'ACGT':
                ans = max(ans, j-i+1)
            else:
                break
    else:
        continue
print(ans)
x = int(raw_input())
y = int(raw_input())
print(x+y/2)

### FIXED CODE ###

import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces
 
x, y = na()
print(x+y//2)
n=int(input())

l=list(map(int,str(n)))

a=sum(l)

if l%9==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=int(input())

l=list(map(int,str(n)))

a=sum(l)

if a%9==0:
  print('Yes')
else:
  print('No')
import collections
import bisect
n,m = map(int, input().split())
p = [list(map(int,input().split())) for i in range(m)]
a = collections.defaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  print("%06d%06d"%(x,bisect.bisect(a[x],y))

### FIXED CODE ###

import collections
import bisect
n,m = map(int, input().split())
p = [list(map(int,input().split())) for i in range(m)]
a = collections.defaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  print("%06d%06d"%(x,bisect.bisect(a[x],y)))
N, K = map(int, input().split())
         
P = list(map(int, input().split()))

P.sort()

ans = 0
for i in range(K):
    ans += P[i]
    
print(ans)


### FIXED CODE ###

str = input()

if str.islower():
	print("a")
else:
    print("A")
x,y=int(input())
print(x*y, (x+y)*2)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,(a+b)*2)
S = input()
ans = "Yes"
for s in S:
    if s in "abc":
        
    else:
        ans = "No"
        break:
print(ans)

### FIXED CODE ###

S = input()
T = "abc" 
ans = "Yes"
for t in T:
    if t in S:
        continue
    else:
        ans = "No"
        break
print(ans)
H, W = map(int, input().split())
graph = []
for _ in range(H):
    graph.append([0 if e == '.' else 1 for e in list(input())])

xx = [-1, 0, 1, 0]
yy = [0, -1, 0, 1]


res = True

for i in range(W):
    for j in range(H):
        if graph[i][j] == 1:
            flag = False
            for idx in range(4):
                nx, ny = i + xx[idx], j + yy[idx]
                if 0 <= x and x < W and 0 <= y and y < H and graph[nx][ny] == 1:
                    flag = True
            if not flag:
                res = False
                break
    if not res:
        break

print('Yes' if res else 'No')


### FIXED CODE ###

H, W = map(int, input().split())
graph = []
for _ in range(H):
    graph.append(list(input()))

res = True

for j in range(1, W-1):
    for i in range(1, H-1):
        if graph[i][j] == '#' and graph[i + 1][j] == '.' and graph[i - 1][j] == '.' and graph[i][j + 1] == '.' and graph[i][j - 1] == '.':
            print('No')
            exit()
print('Yes')
n = int(input())
for i in range(1, 10):
    for l in range(1, 10):
        if n == i*l:
            print('Yes')
            sys.exit()
print('No')

### FIXED CODE ###

import sys
n = int(input())
for i in range(1, 10):
    for l in range(1, 10):
        if n == i*l:
            print('Yes')
            sys.exit()
print('No')
import itertools
H, W, K = map(int,input().split())
S = [list(map(int,list(input()))) for _ in range(H)]
def check(k):
    if k <= K:
        return(True)
    else:
        return(False)
        
noans = 0
def make_lst(i):
    global noans, lst, havelst
    temp = S[0][i]
    for h in range(H-1):
        if y[h]:
            lst.append(temp)
            temp = S[h+1][i]
        else:
            temp += S[h+1][i]
    lst.append(temp)
    if check(max(lst)):
        havelst = 1
    else:
        noans = 1
               
def nocut(i):
    global cutnum, lst, havelst
    prelst = []
    temp = S[0][i]
    j = 0
    for h in range(H-1):
        if y[h]:
            lst[j] += temp
            prelst.append(temp)
            j += 1
            temp = S[h+1][i]
        else:
            temp += S[h+1][i]
    prelst.append(temp)
    lst[-1] += temp
    if check(max(lst)):
        return(True)
    else:
        cutnum += 1
        lst = prelst        
                 
ans = float("inf")
cutlst = []    
for y in itertools.product((0, 1), repeat=H-1):
    havelst = 0
    lst = []
    cutnum = sum(y)
    for x in range(W):
        if noans:
          	noans = 0
            break
        if havelst:
            nocut(x)
        else:
            make_lst(x)
    ans = min(cutnum, ans)
print(ans)
                


### FIXED CODE ###

import itertools
H, W, K = map(int,input().split())
S = [list(map(int,list(input()))) for _ in range(H)]
def check(k):
    if k <= K:
        return(True)
    else:
        return(False)
        
noans = 0
def make_lst(i):
    global noans, lst, havelst
    temp = S[0][i]
    for h in range(H-1):
        if y[h]:
            lst.append(temp)
            temp = S[h+1][i]
        else:
            temp += S[h+1][i]
    lst.append(temp)
    if check(max(lst)):
        havelst = 1
    else:
        noans = 1
#    print(y,i,lst, "makelst")
               
def nocut(i):
    global cutnum, lst, havelst, noans
    prelst = []
    temp = S[0][i]
    if i == W-1:
        if not check(temp):
            noans = 1
    j = 0
    for h in range(H-1):            
        if y[h]:
            lst[j] += temp
            prelst.append(temp)
            j += 1
            temp = S[h+1][i]
        else:
            temp += S[h+1][i]
        if i == W-1:
            if not check(temp):
                noans = 1
    prelst.append(temp)
    lst[-1] += temp
    if check(max(lst)):
#        print(y,i,lst,"nocut", "cutnum = ",cutnum)
        return(True)
    else:
        cutnum += 1
        lst = prelst        
#        print(y,i,lst,"cut","cutnum =",cutnum)
        
                 
ans = float("inf")    
for y in itertools.product((0, 1), repeat=H-1):
    havelst = 0
    lst = []
    cutnum = sum(y)
    for x in range(W):
        if noans:
            break
        if havelst:
            nocut(x)
        else:
            make_lst(x)
#    print(y,cutnum)
    if noans:
        noans = 0
        continue
    else:
        ans = min(cutnum, ans)
print(ans)
N,A,B=int(i) for i in input().split()
if A*N<B:
  print(A*N)
else:
  print(B)

### FIXED CODE ###

N,A,B=(int(i) for i in input().split())
if A*N<B:
    print(A*N)
else:
    print(B)
n,m = map(int,input().split())

root = [-1]*n

def find(x):
    if root[x] < 0:
        return x
    else:
        root[x] = find(root[x])
        return root[x]

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 
    root[x] += root[y]
    root[y] = x

def size(x):
    x = find(x)
    return -root[x]

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

ans = 0
for i in range(n):
    ans = max(ans, size(i))

print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

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

root = [-1]*n

def find(x):
    if root[x] < 0:
        return x
    else:
        root[x] = find(root[x])
        return root[x]

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 
    root[x] += root[y]
    root[y] = x

def size(x):
    x = find(x)
    return -root[x]

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

ans = 0
for i in range(n):
    ans = max(ans, size(i))

print(ans)
# coding: utf-8

import math
import sys
def input(): return sys.stdin.readline().strip()

# N = int(input())
# L = [int(x) for x in input().split()]
A, B, C, D = map(int, input().split())
# S = input()

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


def kosu(n, p):
    return n // p

x = kosu(B, C) - kosu(A - 1, C)
y = kosu(B, D) - kosu(A - 1, D)
z = kosu(B, lcm(C, D)) - kosu(A - 1, lcm(C, D))

print((B - A + 1) - (x + y - z))


### FIXED CODE ###

# coding: utf-8

import sys
def input(): return sys.stdin.readline().strip()

# N = int(input())
# L = [int(x) for x in input().split()]
A, B, C, D = map(int, input().split())
# S = input()

def gcd(x, y):
    if x % y == 0:
        return y
        
    return gcd(y, x % y)


def lcm(x, y):
    return (x * y) // gcd(x, y)


def kosu(n, p):
    return n // p

x = kosu(B, C) - kosu(A - 1, C)
y = kosu(B, D) - kosu(A - 1, D)
z = kosu(B, lcm(C, D)) - kosu(A - 1, lcm(C, D))

print((B - A + 1) - (x + y - z))
# -*- coding: utf-8 -*-

import collections

n = int(input())
balls = list(map(int, input().split(' ')))

for k in range(n):
    # print(balls[ : k])
    # print(balls[ k + 1: ])
    arr = balls[ : k] + balls[ k + 1 : ]

    dic = collections.Counter(arr)
    total = 0
    for v in dic.values():
        total += int(v * (v - 1) / 2)
    print(total)



### FIXED CODE ###

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

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

print(int(m * (m - 1) / 2 + n * (n - 1) / 2))
x,y,z,k = map(int, input().split())
a= list(map(int, input().split()))
b= list(map(int, input().split()))
c= list(map(int, input().split()))

if x>200:
  a.sort()
  a.reverse()
  a=a[0:200]

if y>200:
  b.sort()
  b.reverse()
  b=b[0:200]

if z>200:
  c.sort()
  c.reverse()
  c=c[0:200]

ansList=[]
for m in range(x):
  for n in range(y):
    for o in range(z):
      ansList.append(a[m]+b[n]+c[o])

ansList.sort()
ansList.reverse()

for i in range(k):
  print(ansList[i])


### FIXED CODE ###

x,y,z,k = map(int, input().split())
a= list(map(int, input().split()))
b= list(map(int, input().split()))
c= list(map(int, input().split()))

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

ansListab=[]
for i in range(x):
  for j in range(y):
    ansListab.append(a[i]+b[j])

ansListab.sort(reverse= True)

if len(ansListab)>k:
  ansListab=ansListab[0:k]

ansList=[]

for i in c:
  for j in ansListab:
    ansList.append(i+j)

ansList.sort(reverse= True)

for i in range(k):
  print(ansList[i])
a = int(input())
if a < = 999:
  print("ABC")
else:
  print("ABD")

### FIXED CODE ###

a = int(input())
if a <= 999:
  print("ABC")
else:
  print("ABD")
N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] = "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)

### FIXED CODE ###

N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] == "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)
import itertools
import heapq
import sys
import functools
import operator
import numpy as np
input = sys.stdin.readline
#-------------
n,k = map(int,input().split())
a = list(map(int,input().split()))
#-------------
b = np.abs(a)
b.sort(reverse = True)
b_k = b[k]
a_new = [a[i] for i in range(len(a)) if np.abs(a)[i] > b_k]
 
comb = itertools.combinations(a_new,k)  
l = [list(_) for _ in comb]  
A = (functools.reduce(operator.mul,l[_]) for _ in range(len(l)))
l_max = max(A)
waru = 10**9 + 7
print(l_max % waru)

### FIXED CODE ###

import sys
 
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mod = pow(10, 9)+7
zero = 0
plus = []
minus = []
for i in range(n):
  if a[i] == 0:
    zero += 1
  elif a[i] > 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
 
P, M = len(plus), len(minus)
plus.sort(reverse=True)
minus.sort()
ans = 1
if n == k:
  for i in range(n):
    ans *= a[i]
    ans %= mod
elif P+M < k:
  ans = 0
elif P == 0:
  if zero and k%2:
    ans = 0
  else:
    if k%2:
      minus.reverse()
    for i in range(k):
      ans *= minus[i]
      ans %= mod
else:
  q = 0
  if k%2:
    ans *= plus[0]
    ans %= mod
    q = 1
  judge = []
  for i in range((len(plus)-q)//2):
    judge.append(plus[2*i+q]*plus[2*i+q+1])
  for i in range(len(minus)//2):
    judge.append(minus[2*i]*minus[2*i+1])
  judge.sort(reverse=True)
  for i in range(k//2):
    ans *= (judge[i]%mod)
    ans %= mod
 
print(ans)
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,c = map(int,input().split())
li = [a,b,c]
li.sort()
cnt = 0
while a[2] != a[1]:
    a[0] += 1
    a[1] += 1
    cnt+=1
cnt += (a[1]-a[0])//2
if (a[1]-a[2])%2 != 0:
    cnt += 2
print(cnt)


### FIXED CODE ###

import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,c = map(int,input().split())
li = [a,b,c]
li.sort()
cnt = 0
while li[2] != li[1]:
    li[0] += 1
    li[1] += 1
    cnt+=1
cnt += (li[1]-li[0])//2
if (li[1]-li[0])%2 != 0:
    cnt += 2
print(cnt)
W, H , x, y, r = map(int, raw_input().split())

if x + r < W and x - r < W and y +r < H and y - r < H
  print "Yes"

else:
  print "No"

### FIXED CODE ###

W, H , x, y, r = map(int, raw_input().split())

if (0 <= x + r <= W) and (0 <= x - r <= W) and (0 <= y + r <= H) and (0 <= y - r <= H):
  print "Yes"

else:
  print "No"
n,k = maP(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for i in arr:
  if i >= k:
    ans += 1
print(ans)

### FIXED CODE ###

n,k = map(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for i in arr:
  if i >= k:
    ans += 1
print(ans)
import math
N = int(input())

xi = []
yi = []

for i in range(N):
    x = int(input())
    y = int(input())
    xi.append(x)
    yi.append(x)
    
result = 0
for i in range(N):
    for j in range(N):
        if i != j : 
            result += math.sqrt((xi[j] - xi[i])**2 + (yi[j] - yi[i])**2)
            
print(result/N)

### FIXED CODE ###

import math
N = int(input())
#https://qiita.com/jamjamjam888/items/e066b8c7bc85487c0785
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]
l = 0

for j in range(N):
    for k in range(N):
        if j >= k:
            continue
        l += math.sqrt((x[j] - x[k])**2 + (y[j] - y[k]) ** 2)

print(l * 2/N)
A, B, C, X, Y = map( int, input().split() )

if A + B > 2 * C:
  m = min( X, Y )
  print( min( 2 * C * m + ( X - m ) * A + ( Y - m ) * B, 
              2 * C * m + ( X - m ) * 2 * C + ( Y - m ) * 2 * C ) )
else:
  print( X * A + Y * B )

### FIXED CODE ###

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

R = len( S.replace("W", "") ) 
L = 0
ret = L + R 
for i in range( N ):
  if S[ i ] == "E":
    R -= 1
  ret = min( ret, L + R )
  if S[ i ] == "W":
    L += 1

print( ret )
import itertools

N = int(input())

permu = [i+1 for i in range(N)]
s = 0
flag = False

P = tuple([int(i) for i in input().split(" ")])
Q = tuple([int(i) for i in input().split(" ")])

for i, value in enumerate(itertools.permutations(permu)):
    

    if value == P or value == Q:
        # print(i)
        if flag:
            s -= i
        else:
            s += i
            flag = True

print(abs(s))


### FIXED CODE ###

K, X = [int(i) for i in input().split(" ")]

print("Yes" if 500 * K >= X else "No")