Harryxun/stf_run huggingface dataset:
import math
#n個からr個とるときの組み合わせの数
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

S = int(input())
ans = 0
mod = 10 ** 9 + 7
for i in range(1,S // 3 + 1):      #長さiの数列のとき
   
    x = S - 3 * i       #3を分配後の余り
    
    ans += (combinations_count(x + i - 1, i - 1)) % mod　#重複組み合わせを足す
    ans %= mod

print(ans)


### FIXED CODE ###

import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

S = int(input())
ans = 0
mod = 10 ** 9 + 7
for i in range(1,700):
    x = S - 3 * i
    if x < 0:
        break
    ans += (combinations_count(x + i - 1, i - 1)) % mod
    ans %= mod
print(ans)
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



import sys
from collections import defaultdict
input = sys.stdin.readline
n, m = map(int, input().split())
g = defaultdict(set)

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


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

### FIXED CODE ###

d, t, s = map(int, input().split())

ans = 'Yes' if d/s <= t else 'No'
print(ans)
import math

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

# s = [-1, *a[:-1]]
# t = [*a[1:], -1]
s = [-1] * n
t = [-1] * n
for x in range(0, n - 1):
    s[x + 1] = a[x]
for x in range(1, n):
    t[x - 1] = a[x]

for x in range(1, n - 1):
    s[x + 1] = math.gcd(s[x + 1], s[x])
for x in range(n - 2, 0, -1):
    t[x - 1] = math.gcd(t[x - 1], t[x])

ans = -float('inf')
for x, y in zip(s, t):
    if x == -1:
        ans = max(ans, y)
    elif y == -1:
        ans = max(ans, x)
    else:
        ans = max(ans, math.gcd(x, y))
    
print(ans)

### FIXED CODE ###

def gcd(a, b):
    a, b = min(a, b), max(a, b)
    while b % a != 0:
        a, b = b % a, a
    return a


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

# s = [-1, *a[:-1]]
# t = [*a[1:], -1]
s = [-1] * n
t = [-1] * n
for x in range(0, n - 1):
    s[x + 1] = a[x]
for x in range(1, n):
    t[x - 1] = a[x]

for x in range(1, n - 1):
    s[x + 1] = gcd(s[x + 1], s[x])
for x in range(n - 2, 0, -1):
    t[x - 1] = gcd(t[x - 1], t[x])

ans = -float('inf')
for x, y in zip(s, t):
    if x == -1:
        ans = max(ans, y)
    elif y == -1:
        ans = max(ans, x)
    else:
        ans = max(ans, gcd(x, y))
    
print(ans)
n=int(input())
A=list(map(int,input().split()))
A.sort()
num=[A[0]]
if A[0]==A[1]:
    flag=1
else:
    flag=0
    
for i in range(1,n):
    a=A[i]
    for k in num:
        if a%k==0:
            break

    num.append(a)
    if a==A[i+1]:
        flag+=1
ans=len(num)-flag
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
D=set()
S=set()
for i in range(N):
    if A[i] in S:
        D.add(A[i])
    else:
        S.add(A[i])
M=max(S)
X=[1 for i in range(M+1)]
for a in S:
    if a in D:
        X[a]=0
    for i in range(2*a,M+1,a):
        X[i]=0
ans=0
for i in range(N):
    if X[A[i]]==1:
        ans+=1
print(ans)
import math
X = int(input())
print( math.cecil((X / 11) * 2))

### FIXED CODE ###

import math
X = int(input())
b = math.floor((X / 11))*2
if((X % 11) > 0 and (X % 11) < 7):
    print(b + 1)
elif((X % 11) > 0 and X % 11 < 11):
    print(b + 2)
else:
    print(b)
in = input().split()

print('%s %s %s' % (in[2],in[0],in[1]))


### FIXED CODE ###

x = input().split()

print('%s %s %s' % (x[2],x[0],x[1]))
N=int(input())
import ita
data=ita.array.make1d(N)
for i in range(0,N):
    c=0
    while i%2==0:
        c=c+1
    data[i]=c
for k in range(0,N):
    if data[k]==max(data):
        print(k+1)

### FIXED CODE ###

N=input()
print('ABC'+N)
a,b,n = list(map(int, input().split()))
def f(x):
    return a*x//b - a*(x//b)

left=1
right=n
for _ in range(100):
    delta=(right-left)/3
    midl=left+delta
    midr=midl+delta
#    print(f'left={left} midl={midl} midr={midr} right={right}')
    if f(midl)>f(midr):
        right=midr
    else:
        left=midl
print(max(f(int(midl)),f(min(int(midl)+1),n)))

### FIXED CODE ###

a,b,n = list(map(int, input().split()))
def f(x):
    return a*x//b - a*(x//b)

left=1
right=n
for _ in range(100):
    delta=(right-left)/3
    midl=left+delta
    midr=midl+delta
#    print(f'left={left} midl={midl} midr={midr} right={right}')
    if f(midl)>f(midr):
        right=midr
    else:
        left=midl
print(max(f(int(midl)),f(min(int(midl)+1,n))))
s=input()
l=[]
for i in s:
  if i=="0":
    l.append("0")
  elif i=="1":
    l.append("1")
  else:
    l.pop()
print("".join(l))

### FIXED CODE ###

s=input()
l=[]
for i in s:
  if i=="0":
    l.append("0")
  elif i=="1":
    l.append("1")
  elif i=="B":
    if l!=[]:
    	l.pop()
if l==[]:
  print("")
else:
  print("".join(l))
if n == 1:
    print(1)

else:
    for i in range(2,11):
        for j in range(2,11):
            if i ** j <= n:
                Min = min(Min,n - i ** j)
    print(n - Min)

### FIXED CODE ###

n = int(input())
if n == 1:
    print(1)
else:
    ans = 1
    for i in range(2,n):
        temp = i ** 2
        while temp <= n:
            ans = max(ans,temp)
            temp *= i
    print(ans)
N = int(input())
A = int(input())
if N%500 =< A:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())
A = int(input())
if N%500 <= A:
  print('Yes')
else:
  print('No')
import heapq

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

max_v = -float('inf')
for a in range(max(k,n)):
    total = 0
    minus = []
    for i in range(a):
        total += vs[i]
        if vs[i] < 0:
            heapq.heappush(minus, vs[i])
    for b in range(max(k-a,n-a)):
        c = k - a - b
        if c < 0:
            break
        h = minus[:]
        t = total
        for i in range(b):
            t += vs[n-1-i]
            if vs[n-1-i] < 0:
                heapq.heappush(h, vs[n-1-i])
        for i in range(c):
            if h:
                v = heapq.heappop(h)
                t -= v
        max_v = max(max_v, t)

print(max_v)        


### FIXED CODE ###

import heapq

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

max_v = -float('inf')
for a in range(min(k, n)+1):
    total = 0
    minus = []
    for i in range(a):
        total += vs[i]
        if vs[i] < 0:
            heapq.heappush(minus, vs[i])
    max_v = max(max_v, total)
    for b in range(min(k-a, n-a)+1):
        c = k - a - b
        if c < 0:
            break
        h = minus[:]
        t = total
        for i in range(b):
            t += vs[n-1-i]
            if vs[n-1-i] < 0:
                heapq.heappush(h, vs[n-1-i])
        for i in range(c):
            if h:
                v = heapq.heappop(h)
                t -= v
            else:
                break
        max_v = max(max_v, t)

print(max_v)
S , T = map(str, input().split())
if T == S + T[:-1]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S= input()
T= input()
if T == S + T[-1]:
  print('Yes')
else:
  print('No')
# -*- coding: utf-8 -*-
import fractions
 
N,X = map(int, input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
y=[]
 
i=0
while i < n:
    y.append(x[i+1]-x[i])
    i +=1
y.sort()
 
y=list(set(y))
m=len(y)
z=y[0]
i=0
while i < m:
    z=fractions.gcd(z,y[i])
    i+=1
 
print(z)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import fractions
import numpy as np
 
N,X = map(int, input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
 
x=np.array(x)
 
y=x[1:]-x[:-1]
 
y.sort()
y=list(set(y))
z=y[0]
m=len(y)
i=0
while i < m:
    z=fractions.gcd(z,y[i])
    i+=1
 
print(z)
n = int(input())
s_list = [input() for i in range(n)]
s_set = set(s)
max = 0
max_elements = []
for i in s_set:
    c = s_list.count(i)
    if c > max:
        max = c
        max_elements = [i]
    if c == max and i not in max_elements:
        max_elements.append(i)

for i in sorted(max_elements):
    print(i)


### FIXED CODE ###

a, b, c = input().split()
count = 0
if(a == b): count += 1
if(b == c): count += 1
if(c == a): count += 1

print("Yes" if(count == 1) else "No")
print((lambda x: x[0]//x[1])(map(int,input().split())))

### FIXED CODE ###

print((lambda x: (x[0]-1)//x[1]+1)(list(map(int,input().split()))))
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b);

def lcm(a, b):
    return int(a * b / gcd(a, b));

N = input()
V = 1
for i in range(int(N)):
    T = input()
    V = lcm(V, int(T));
print(V)

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return a // gcd(a, b) * b

N = input()
V = 1
for i in range(int(N)):
    T = input()
    V = lcm(V, int(T))

print(V)
S = input()

ans="No"
if S[0] == S[1] and S[0] != S[2] and S[0] != S[3] and S[2] == S[3]:
  ans = "Yes"
elif S[1] == S[2] and S[1] != S[0] and S[1] != S[3] and S[0] == S[3]:
  ans = "Yes"
elif S[2] == S[3] and S[2] != S[0] and S[2] != S[1] and S[0] == S[1]:
  ans = "Yes"
elif S[3] == S[0] and S[3] != S[1] and S[3] != S[2] and S[1] == S[2]:
  ans = "Yes"
elif S[1] == S[3] and S[1] != S[0] and S[1] != S[2] and S[2] == S[4]:
  ans = "Yes"

print(ans)

### FIXED CODE ###

S = input()

ans="No"
if S[0] == S[1] and S[0] != S[2] and S[0] != S[3] and S[2] == S[3]:
  ans = "Yes"
elif S[1] == S[2] and S[1] != S[0] and S[1] != S[3] and S[0] == S[3]:
  ans = "Yes"
elif S[2] == S[3] and S[2] != S[0] and S[2] != S[1] and S[0] == S[1]:
  ans = "Yes"
elif S[3] == S[0] and S[3] != S[1] and S[3] != S[2] and S[1] == S[2]:
  ans = "Yes"
elif S[1] == S[3] and S[1] != S[0] and S[1] != S[2] and S[2] == S[0]:
  ans = "Yes"

print(ans)
n = int(input()
list = []
for a in range(2,n-1):
        sum = 0
        sum1 = 0
        b = n - a
        for j in range(len(str(a))):
                sum += int(str(a)[j])
        for k in range(len(str(b))):
                sum1 += int(str(b)[k])
        list.append(sum + sum1)
print(min(list))

### FIXED CODE ###

n = int(input())
l = []
for a in range(1,n):
        sum = 0
        sum1 = 0
        b = n - a
        for i in range(len(str(a))):
                sum += int(str(a)[i])
        for i in range(len(str(b))):
                sum1 += int(str(b)[i])
        l.append(sum+sum1)
print(min(l))
def search_max_gcd(M, possible):
    if possible == 1:
        return 1
    elif (M % possible) == 0:
        return possible
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()

### FIXED CODE ###

from math import *

def main():
    N, M = map(int, input().split())
    if N==1:
        print(M)
        return
    special_value = M//N
    divisor_set = set(i for i in range(1, (int(sqrt(M)) + 1)) if (M % i == 0))
    divisor_set = divisor_set.union(M/j for j in divisor_set)
    print(int(max([i for i in divisor_set if special_value >= i])))
    return

main()
n = int(raw_input())
a = map(int,raw_input().split())
a.reverse()
for i in n:
    print i,

### FIXED CODE ###

n = int(raw_input())
a = map(int,raw_input().split())
a.reverse()
for i in a:
    print i,
a,b,c=map(int,raw_input().split())
if a+b=>c:
  print "Yes"
else:
  print "No"


### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if a + b >= c:
  print "Yes"
else:
  print "No"
from functools import reduce
from math import gcd
a,b = map(int,input().split())
li = list(map(int,input().split()))
li = [abs(x-int(b)) for x in li]
print(reduce(gcd,li))

### FIXED CODE ###

n, x = map(int,input().split())
li = list(input().split())
li = [abs(int(a)-x) for a in li]

def gcd(a,b):
    while a%b!=0:
        a,b = b,a%b
    return b
    
if n == 1:
    print(abs(li[0]))
    
elif n == 2:
    print(gcd(li[0],li[1]))
    
elif n >= 3:

    c = gcd(li[0],li[1])
    #print(c)
    for i in range(2,len(li)-1):
        c = gcd(c,li[i])
    print(c)
ALL = input().split()
N = int(ALL[0])
K = int(ALL[1])

if (N - K) % (K - 1) == 0:
    answer = (N - K) // (K - 1) + 1
else:
    answer = (N - K) // (K - 1) + 2

print(answer)

### FIXED CODE ###

S = input()
S = list(S)

A = 0

for i in range(4):
    if S[i] == '+':
        A = A + 1
    elif S[i] == '-':
        A = A - 1

print(A)
n = int( input() )
l = [[]] * n
for i in range( n ):
  a = int( input() )
  k = [ -1 ] * n
  for _ in range( a ):
    x, y = map( int, input().split() )
    k[ x - 1 ] = y
  l[ i ] = k

ret = 0
for i in range( 2 ** n - 1, 0, -1 ):
  o = [int(i) for i in str( "{:b}".format(i).zfill(n) )]
  is_right = True
  for j in range( n ):
    for m in range( n ):
      if o[j] == 1:
        is_rzight &= ( l[j][m] in [-1, o[m]] )
    if not is_right:
      break
        
  if is_right:
    ret = sum(o)
    break
          
print( ret )


### FIXED CODE ###

n = int( input() )
l = [[]] * n
for i in range( n ):
  a = int( input() )
  k = [ -1 ] * n
  for _ in range( a ):
    x, y = map( int, input().split() )
    k[ x - 1 ] = y
  l[ i ] = k

ret = 0
for i in range( 2 ** n - 1, 0, -1 ):
  o = [int(i) for i in str( "{:b}".format(i).zfill(n) )]
  is_right = True
  for j in range( n ):
    for m in range( n ):
      if o[j] == 1:
        is_right &= ( l[j][m] in [-1, o[m]] )
    if not is_right:
      break
        
  if is_right:
    ret = sum(o)
    break
          
print( ret )
def main():
    N, Q = map(int, input().split())
    s = input()
    l = []
    for _ in range(Q):
        t, d = input().split()
        l.append((t, d))
    lmax = N
    lmin = 1
    rmax = N
    rmin = 1
    # find most left R
    while rmax != rmin:
        m = t = (rmax + rmin) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == N+1:
                rmax = m
                break
        else:
            rmin = m + 1
    # find most right L
    while lmax != lmin:
        m = t = (lmax + lmin + 1) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == 0:
                lmin = m
                break
        else:
            lmax = m - 1
    if rmax == N:
        print(rmax-lmax)
    else:
        print(rmax-lmax-1)
main()


### FIXED CODE ###

def main():
    N, Q = map(int, input().split())
    s = input()
    l = []
    for _ in range(Q):
        t, d = input().split()
        l.append((t, d))
    lmax = N + 1
    lmin = 0
    rmax = N + 1
    rmin = 0
    # find most left R
    t = N
    for i in range(Q):
        if s[t-1] == l[i][0]:
            if l[i][1] == 'L':
                t -= 1
            else:
                t += 1
        if t == N+1:
            break
        if t == 0:
            print('0')
            return 0
    else:
        rmin = N + 1
    while rmax != rmin:
        m = t = (rmax + rmin) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == N+1:
                rmax = m
                break
            if t == 0:
                rmin = m + 1
                break
        else:
            rmin = m + 1
    t = 1
    for i in range(Q):
        if s[t-1] == l[i][0]:
            if l[i][1] == 'L':
                t -= 1
            else:
                t += 1
        if t == 0:
            break
        if t == N + 1:
            print('0')
            return 0
    else:
        lmax = 0
 
    # find most right L
    while lmax != lmin:
        m = t = (lmax + lmin + 1) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == 0:
                lmin = m
                break
            if t == N + 1:
                lmax = m - 1
                break
        else:
            lmax = m - 1
    print(rmax-lmax-1)
main()
n,m,k=map(int,input().split())
q=[]
friend=[0]*n
block=[[] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    q.append({a-1,b-1})
    friend[a-1]+=1
    friend[b-1]+=1
while 1:
    a=q.pop()
    for j in q:
        if len(j&a)!=0:
            j|=a
            count=0
            break
    else:
        q=[a]+q
    if count>len(q):
        break
    count+=1
s=[0]*n
for i in range(n):
  for j in range(len(q)):
    if i in q[j]:
      s[i]=j
for _  in range(k):
    a,b= map(int,input().split())
    block[a-1].append(b-1)
    block[b-1].append(a-1)
ans=[-1]*n
for i in range(n):
  for j in q[s[i]]:
    ans[i]-=block[i].count(j)
for i in range(n):
  ans[i]+=len(q[s[i]])
for i in range(n):
  ans[i]-=friend[i]
print(*ans)

### FIXED CODE ###

class UnionFind():
    def __init__(self,n):
      self.n=n
      self.root=[-1]*(n+1)
      self.rank=[0]*(n+1)
      
    def find(self,x):
      if self.root[x]<0:
        return x
      else:
        self.root[x]=self.find(self.root[x])
        return self.root[x]
    
    def unite(self,x,y):
      x=self.find(x)
      y=self.find(y)
      if x==y:
        return 0
      elif self.rank[x]>self.rank[y]:
        self.root[x]+=self.root[y]
        self.root[y]=x
      else:
        self.root[y]+=self.root[x]
        self.root[x]=y
        if self.rank[x]==self.rank[y]:
          self.rank[y]+=1
          
    def Same(self,x,y):
      return self.find(x)==self.find(y)
    
    def size(self,x):
      return -self.root[self.find(x)]
import sys
input=sys.stdin.buffer.readline
n,m,k=map(int,input().split())
link=UnionFind(n)
f=[0]*n
block=[[] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    link.unite(a,b)
    f[a]+=1
    f[b]+=1
for _ in range(k):
    a,b=map(int,input().split())
    block[a-1].append(b-1)
    block[b-1].append(a-1)
ans=[]
for i in range(n):
  ret=link.size(i)-f[i]-1
  for j in block[i]:
    if link.Same(i,j):
      ret-=1
  ans.append(ret)
print(*ans)
n = input()
for i in range(0,len(n)-1,1):
  if (n[i] == n[i+1]):
    print("Bad")
    else:
    print("Good")

### FIXED CODE ###

n = input()
for i in range(len(n) -1):
  if (n[i] == n[i+1]):
      print("Bad")
      break
else: 
    print("Good")
class queue():
    def __init__(self):
        self.head = 0
        self.tail = 0
        self.MAX = 100000
        self.Q = [[0] for i in range(self.MAX-1)]

    def is_empty(self):
        return self.head == self.tail

    def is_full(self):
        return self.head == (self.tail + 1) % self.MAX

    def enqueue(self, x):
        if self.is_full():
            raise ValueError("エラー（オーバーフロー）")
        self.Q[self.tail] = x
        if self.tail + 1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1

    def dequeue(self):
        if self.is_empty():
            raise ValueError("エラー（アンダーフロー）")
        x = self.Q[self.head]
        if self.head + 1 == self.MAX:
            self.head = 0
        else:
            self.head += 1
        return x

n, q = input().split(" ")
n = int(n)
q = int(q)
q_name = queue()
q_val = queue()
for i in range(n):
    name, t = input().split(" ")
    t = int(t)
    q_name.enqueue(name)
    q_val.enqueue(t)

results = []
end_time = 0
while True:
    process_val = q_val.dequeue()
    process_name = q_name.dequeue()
    if process_val <= q:
        end_time += process_val
        results.append([process_name, end_time])
    else:
        end_time += q
        rest_val = process_val - q
        q_name.enqueue(process_name)
        q_val.enqueue(rest_val)
    
    if q_val.head == q_val.tail:
        break

for v in results:
    print("{} {}".format(v[0],v[1]))


### FIXED CODE ###

class queue():
    def __init__(self):
        self.head = 0
        self.tail = 0
        self.MAX = 100000
        self.Q = [[0] for i in range(self.MAX)]

    def is_empty(self):
        return self.head == self.tail

    def is_full(self):
        return self.head == (self.tail + 1) % self.MAX

    def enqueue(self, x):
        if self.is_full():
            raise ValueError("エラー（オーバーフロー）")
        self.Q[self.tail] = x
        if self.tail + 1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1

    def dequeue(self):
        if self.is_empty():
            raise ValueError("エラー（アンダーフロー）")
        x = self.Q[self.head]
        if self.head + 1 == self.MAX:
            self.head = 0
        else:
            self.head += 1
        return x

n, q = input().split(" ")
n = int(n)
q = int(q)
q_name = queue()
q_val = queue()
for i in range(n):
    name, t = input().split(" ")
    t = int(t)
    q_name.enqueue(name)
    q_val.enqueue(t)

results = []
end_time = 0
while True:
    process_val = q_val.dequeue()
    process_name = q_name.dequeue()
    if process_val <= q:
        end_time += process_val
        results.append([process_name, end_time])
    else:
        end_time += q
        rest_val = process_val - q
        q_name.enqueue(process_name)
        q_val.enqueue(rest_val)
    
    if q_val.head == q_val.tail:
        break

for v in results:
    print("{} {}".format(v[0],v[1]))
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag=True :
  print('Yes')
else :
  print('No')
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')


### FIXED CODE ###

NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')
S = list(input())
S_unique = list(set(S))

alpha = list("abcdefghijklmnopqrstuvwxyz")


if len(S_unique) != 26:
    for i in range(len(alpha)):
        if alpha[i] not in S_unique:
            ans = alpha[i]
            break

a = ''.join(S) + ans
print(a)


### FIXED CODE ###

#%%
alpha2num = lambda c: ord(c) - ord('a') + 1
num2alpha = lambda c: chr(c+64)
S = list(input())

S = S[::-1]
alpha = 'abcdefghijklmnopqrstuvwxyz'
alpha = list(alpha)

a = 0

if len(S) != 26:
    for i in range(len(alpha)):
        if alpha[i] not in S:
            b = alpha[i]
            break
    ans = ''.join(S)[::-1] + b
else:
    for i in range(1,len(S)):
        if S[i] < S[i-1]:
            a = i
            break
    if a == 0:
        ans = -1
    else:
        for i in range(len(alpha)):
            if alpha[i] not in S[a+1:] and alpha[i] > S[a]:
                c = alpha[i]
                break
        ans = (c + ''.join(S[a+1:]))[::-1]

print(ans)

#%%
numTest = int(input())

inputLine = input()

print(inputLine[0 : numTest] + '...' if len(inputLine) > numTest else inputLine

### FIXED CODE ###

numTest = int(input())

inputLine = input()

print(inputLine[0 : numTest] + '...' if len(inputLine) > numTest else inputLine)
def f(s):
  m,y = int(s[:2]), int(s[2:])
  return (0 < m <= 12,0 < y <= 12 )

p,q = map(int,list(f(raw_input()))
print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[(p,q)]


### FIXED CODE ###

def f(s):
  m,y = int(s[:2]), int(s[2:])
  return 0< m <= 12

def g(s):
  y,m = int(s[:2]), int(s[2:])
  return 0< m <= 12
    
s = raw_input()
p,q = f(s), g(s)

if p and q:
  print 'AMBIGUOUS'
elif p and not(q):
  print 'MMYY'
elif q and not(p):
  print 'YYMM'
else:
  print 'NA'