Harryxun/stf_run huggingface dataset:
import sys
c = [0]*26
b = "abcdefghijklmnopqrstuvwxyz"
a = sys.stdin.read()
for A in a:
    k = 0
    for B in b:
        if A == B or A == B.upper():
            c[k] += 1
            break
        index += 1
for i in range(len(b)):
    print("%s : %d"%(letters[i],c[i]))


### FIXED CODE ###

import sys
x = ""
x = sys.stdin.read()
# while True:
#     x += str(input())
#     t = time.time()

alist = list(x)
alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ALPHABET = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
aa = [0]*27
for num in alist:
    itr =0
    for alp in alphabet:
        if num == alp:
            aa[itr] += 1
            break;
        itr += 1
    itr = 0
    for ALP in ALPHABET:
        if num == ALP:
            aa[itr] += 1
            break;
        itr += 1
for i in range(26):
    print("{} : {}".format(alphabet[i], aa[i]))
a = int(input())
b = int(input())

if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

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

if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")
c = list
for i in range(3):
  a=list(map(int,input().split()))
  c.append(a)
br = 0
for i in range(2):
  for j in range(2):
    if(c[i][j]+c[i+1][j+1]==c[i][j+1]+c[i+1][j]):
      None
    else:
      br+=1
      break
if(br==0):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

c = list
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
c=[p,q,r]
br = 0
for i in range(2):
  for j in range(2):
    if(c[i][j]+c[i+1][j+1]==c[i][j+1]+c[i+1][j]):
      None
    else:
      br+=1
      break
if(br==0):
  print("Yes")
else:
  print("No")
def solve(n, x):
    layers = 2 ** (n + 1) - 3  # レベルn-1バーガーの層の数
    patties = 2 ** n - 1    # レベルn-1バーガーのパティの数
    if x == 0:
        ans = 0
    elif x <= layers + 1:
        ans = solve(n - 1, x - 1)
    else:
        ans = patties + 1 + solve(n - 1, x - layers - 2)
        
    return ans

N, X = [int(x) for x in input().split()]
print(solve(N, X))

### FIXED CODE ###

# レベルiバーガーの層数は 2^(i+2) - 3
def layers(i):
    return 2 ** (i + 2) - 3

# レベルiバーガーのパティ数は 2^(i+1) - 1
def patties(i):
    return 2 ** (i + 1) - 1

def solve(n, x):
    layers = 2 ** (n + 1) - 3  # レベルn-1バーガーの層の数
    patties = 2 ** n - 1    # レベルn-1バーガーのパティの数
    if x == 0:
        ans = 0
    elif x < layers + 1:
        ans = solve(n - 1, x - 1)
    elif x == layers + 1:
        ans = patties
    elif x == layers + 2:
        ans = patties + 1
    elif x < 2 * layers + 2:
        ans = patties + 1 + solve(n - 1, x - layers - 2)
    else:
        ans = 2 * patties + 1
    return ans

N, X = [int(x) for x in input().split()]
print(solve(N, X))
import re

stack = []
_l = input().split(' ')

for c in _l:
    stack += [c]
    if re.match('/(+|-|/|*)/', c):
        f = stack.pop()
        z = stack.pop()
        stack.append(eval("{}{}{}".format(z, c, f)))

print(stack[0])

### FIXED CODE ###

import re

stack = []
_l = input().split(' ')

for c in _l:
    if re.match(r"(\+|\-|\/|\*)", c):
        f = stack.pop()
        z = stack.pop()
        stack.append(eval("{}{}{}".format(z, c, f)))
    else:
        stack += [c]

print(stack[0])
S,T=map(str,input.split())
s,t=map(int,input.split())
U=input()

if S==U:
    print(s-1,t)
elif T==U:
    print(s,t-1)



### FIXED CODE ###

S,T=map(str,input().split())
s,t=map(int,input().split())
U=input()

if S==U:
    print(s-1,t)
elif T==U:
    print(s,t-1)
N = int(input())
A = list(map(int, input()))
A.sort()
print(A[-1] - A[0])

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
print(A[-1] - A[0])
def resolve():
    N=int(input())
    def make_divisors(n):
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i: # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        # divisors.sort() # ソートしたけりゃして
        return divisors
    l=make_divisors(N)
    ls=len(l)
    l1=l[-1]
    l2=l[-2]

    if len(l)%2==0:
        print(max(len(str(l1)),len(str(l2))))
    else:
        print(len(str(l1)))
        

resolve()

### FIXED CODE ###

def resolve():
    N=int(input())
    def make_divisors(n):
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i: # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        # divisors.sort() # ソートしたけりゃして
        return divisors
    l=make_divisors(N)
    ls=len(l)
    l1=l[-1]
    try:
        l2=l[-2]
    except:
        pass

    if len(l)%2==0:
        print(max(len(str(l1)),len(str(l2))))
    else:
        print(len(str(l1)))
        

resolve()
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
C = []
T1 = []

for i in range(n):
  C.append(ct[i][0])
  T1.append(ct[i][1])

if min(T1) > t:
  print("TLE")

for i in range(n):
  mc = min(C)
  if ct[C.index(min(C))][1] > t:
    C.remove(min(C))
    ct.remove(ct[C.index(min(C))])
  else:
    break
    
print(min(C))

### FIXED CODE ###

n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)
#!/usr/bin/env python3
from itertools import takewhile
from math import sqrt


def is_prime(primes, i):
    if i in primes:
        return True
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True


def sieve_of_eratosthenes(max):
    is_prime = [True] * (max + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
    return filter(lambda x: is_prime[x], range(max + 1))

primes = set(sieve_of_eratosthenes(10000))

n = int(input())
c = 0
for _ in range(n):
    i = int(input())
    if is_prime(i):
        c += 1
print(c)

### FIXED CODE ###

#!/usr/bin/env python3
from itertools import count, takewhile


def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i)


def is_prime(primes, i):
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True

primes = list(takewhile(lambda x: x < 10000, prime()))

n = int(input())
c = 0
for _ in range(n):
    i = int(input())
    if is_prime(primes, i):
        c += 1
print(c)
n,m = map(int,input().split())
food = [0 for i in range(m)]
for i in range(n):
    k = int(input())
    for j in range(k):
        food[int(input())] = 1
print(food.index(0))

### FIXED CODE ###

n,m = map(int,input().split())
food = [0 for i in range(m+1)]
for i in range(n):
    a = input().split()
    for j in range(1,int(a[0])+1):
        food[int(a[j])] += 1
count = 0
for i in food:
    if i == n:
        count += 1
print(count)
input()
b = [int(i) for i in input().split()]

if 0 not in b:
  last = 1
  for i in b:
      last*=i
      if last > 10**18:
        last = -1
        break
    
else:
  last = 0
    
print(last)

### FIXED CODE ###

a=[int(i) for i in input().split()]
print(a[0] * a[1])
N = int(input())
print(int((N+1)*N/2))

### FIXED CODE ###

S = list(input())
T = list(input())
cnt = 0
for i in range(3):
    if S[i] == T[i]:
        cnt += 1
print(cnt)
a,b = input().split()
a = float(a)
b = float(b*100)
print(a*b//100)

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)
a, b = map(int,input().split())

if a >= 13:
  print(b)
  end()
  
if a >= 6:
  b /= 2
  print(b)
  end()
  
print(0)


### FIXED CODE ###

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

if a >= 13:
  print(b)
  
elif a >= 6:
  b //= 2
  print(b)
  
else:
  print(0)
a = int(input())
b = int(input())
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(int(ans))
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

inp = input().split(" ")
a = int(inp[0])
b = int(inp[1])
 
c = (a - b) % 2 
if c == 0:
  abs_a = abs(a)
  abs_b = abs(b)
 
  m = (max(abs_a, abs_b) - min(abs_a, abs_b)) /2
  ans = max(abs_a, abs_b) - m
  print(int(ans))
else:
  print("IMPOSSIBLE")
S = input()
T = input()

print(if S == T[:-1]'Yes' else 'No')

### FIXED CODE ###

S = input()
T = input()
if S == T[:-1]:
  print('Yes')
else:
  print('No')
A=list(map(int,input().split)
print(A[0]*A[1])

### FIXED CODE ###

A=list(map(int,input().split()))
print(A[0]*A[1])
a = int(input())
b = int(input())

area = a * b
length = 2* a + 2 * b

print(area length)

### FIXED CODE ###

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

area = a*b
length = 2 * (a+b)

print(area,end=" ")
print(length)
from sys import stdin


def main():
    n = int(input())

    p = stdin.readline().split()
    count = 0

    for i in range(1 , n):
        if p[i-1] >= p[i] >=p[i+1] and  p[i-1] != p[i] or p[i-1] <= p[i] <=p[i+1] and p[i] !=p[i+1]:
            count +=1
    
    print(count)


if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin


def main():
    n = int(input())

    p = [int(x) for x in stdin.readline().split()]
    count = 0

    for i in range(1 , n-1):
        if p[i-1] > p[i] >p[i+1] or p[i-1] < p[i] < p[i+1]:
            count +=1
    
    print(count)


if __name__ == "__main__":
    main()
X, N = map(int, input().split())
A = [map(int, input().split())]
a = 0
while True:
  if X-a in A:
    if X+a in A:
    a += 1
    else:
      print(X+a)
      break
  else:
    print(X-a)
    break

### FIXED CODE ###

X, N = map(int, input().split())
A = list(map(int, input().split()))
a = 0
while True:
  if X-a not in A:
      print(X-a)
      break
  if X+a not in A:
      print(X+a)
      break
  a += 1
k = int(input())
x =[int(0)]*3234566669
count=0
mem=0
for a in range(k*k):
    n = str(a)
    if(len(n))==1:
        x[int(n)]=1
        mem=int(n)
        count+=1
    elif x[int(n[:-1])]==1 and abs(int(n[-1])-int(n[-2]))<2:
        x[int(n)]=1
        mem=int(n)
        count+=1
    if count>k:
        break
print(mem)

### FIXED CODE ###

x,y,z = map(int,input().split())
print(z,x,y)
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
booka = 0
bookb = 0
booknum = 0
time = 0
ba=0
bb=0
lim = 0
while True:
    if booka >= N:
        while time<=K and bookb<M:
            bb += 1
            time += B[bookb]
            bookb += 1
        break
    if bookb>=M:
        while time<=K and booka<N:
            ba += 1
            time += A[booka]
            booka += 1
        break
    if A[booka]<B[bookb]:
        if A[booka]+A[booka+1] > B[bookb]+B[bookb+1]:
            time += B[bookb]
            bookb += 1
        else:
            time += A[booka]
            booka += 1
    else:
        if A[booka]+A[booka+1] <= B[bookb]+B[bookb+1]:
            time += A[booka]
            booka += 1
        else:
            time += B[bookb]
            bookb += 1
    if time >K:
        break
    booknum += 1
    while (booka == N-1 or bookb == M-1) and time <= K:
        if A[booka]<B[bookb]:
            time += A[booka]
            booka += 1
            if time > K:
                booknum += 1
        else:
            time += B[bookb]
            bookb += 1
            if time > K:
                booknum += 1
if time > K and (bb!=0 or ba!=0):
    booknum-=1
booknum += (ba+bb)

print(booknum)


### FIXED CODE ###

def getmax(x,y):
    if x>y:
        return x
    else:
        return y
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a,b = [0],[0]
for i in range(N):   #a[i]にはAの本をi冊読んだ時の時間がそれぞれ保存されている．
    a.append(a[i]+A[i])  #計算量を減らすため，a[i]（1冊前までにかかる時間）を用いる
for i in range(M):
    b.append(b[i]+B[i])

ans,j = 0,M
for i in range(N+1):
    if a[i]>K:
        break
    while b[j] > K-a[i]:    #Bの本を読んだ場合の処理はここで実行される．
        j -=1
    ans = max(ans, i+j)
print(ans)
def hankei(x):
  print(x**2)
print(r)

### FIXED CODE ###

r=int(input())
print(r**2)
import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**5)

def search(u, n, g, disc, k):
    if disc[u] != None:
        circles = n - disc[u]
        v = (k - disc[u]) % circles
        ans = u
        for i in range(v):
            ans = g[ans]
        return ans + 1
    disc[u] = n
    return search(g[u], n+1, g, disc, k)
resolve()

### FIXED CODE ###

import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**5*2)

def search(u, n, g, disc, k):
    if disc[u] != None:
        circles = n - disc[u]
        v = (k - disc[u]) % circles
        ans = u
        if n > k:
            ans = 0
            for _ in range(k):
                ans = g[ans]
            return ans + 1
        for i in range(v):
            ans = g[ans]
        return ans + 1
    disc[u] = n
    return search(g[u], n+1, g, disc, k)

def resolve():
    n, k = map(int, input().split())
    g = list(map(lambda x: int(x) - 1, input().split()))
    disc = [None]*n
    v = search(0, 0, g, disc, k)
    print(v)
resolve()
hitachi = input()
print(hitachi)
flag = 0
for x in range(len(hitachi)):
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            flag = 1
        else:
            print(hitachi[x] + hitachi[x+1])
            print("No")
            break

if(flag == len(hitachi)/2):
    print("Yes")

### FIXED CODE ###

hitachi = input()
#type(hitachi)
flag = 0
if(len(hitachi) == 1):
    hitachi += " "
elif(len(hitachi) >= 11):
    hitachi = " "
elif(len(hitachi) % 2 ==1):
    hitachi += " "
for x in range(len(hitachi)):
    if(hitachi[x] == " "):
        break
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            #print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            #print(hitachi[x] + hitachi[x+1])
            print("No")
            break
if(not len(hitachi) == 0):
    if(flag == len(hitachi)//2):
        print("Yes")
a = int(input())
    b = int(input())
     
    if a<=8 and b<=8 :
        print("Yay!")
    else:
        print(":(")

### FIXED CODE ###

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

if a<=8 and b<=8 :
    print("Yay!")
else:
    print(":(")
n = int(input())
a = list(map(int,input().split()))
li = []
for i in range(n):
    if a[i] < 200000:
        li.append([a[i],i])
li.sort()
cnt = 0
for i in range(n-1):
    j = i+1
    while j <= n-1 and li[i][0] + li[j][0] < 200000:
        if abs(li[j][1]-li[i][1]) == li[i][0] + li[j][0]:
            cnt += 1
        j += 1
print(cnt)

### FIXED CODE ###

from collections import Counter
n = int(input())
ai = list(map(int,input().split()))
pl = []
mi = []
for i in range(n):
    pl.append(i+ai[i])
    mi.append(i-ai[i])
x = Counter(pl)
y = Counter(mi)
cnt = 0
for i in x.keys():
    cnt += x[i]*y[i]
print(cnt)
import sympy

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

D = [[]]
for i in range(1, N):
  DD = []
  T = [0]
  for j in range(i, N, i):
    T.append(T[-1] + s[j])
  DD.append(T)
  T = [0]
  start = (N - 1) % i
  if start == 0: start += i
  for j in range(start, N, i):
    T.append(T[-1] + s[j])
  DD.append(T)
  D.append(DD)

ans = s[-1]
cnt = 0
for n in range(2, N - 1):
  end = N - 1 - n
  for m in sympy.divisors(end):
    if n <= m: break
    if n % m == 0 and end >= n: continue
    k = end // m
    a = D[m][0][k]
    l = len(D[m][1])
    b = D[m][1][-1] - D[m][1][l - k - 2]
    ans = max(ans, a + b)

print(ans)

### FIXED CODE ###

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

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

D = [[]]
for i in range(1, N):
  DD = []
  T = [0]
  for j in range(i, N, i):
    T.append(T[-1] + s[j])
  DD.append(T)
  T = [0]
  start = (N - 1) % i
  if start == 0: start += i
  for j in range(start, N, i):
    T.append(T[-1] + s[j])
  DD.append(T)
  D.append(DD)

ans = s[-1]
cnt = 0
for n in range(2, N - 1):
  end = N - 1 - n
  for m in make_divisors(end):
    if n <= m: break
    if n % m == 0 and end >= n: continue
    k = end // m
    a = D[m][0][k]
    l = len(D[m][1])
    b = D[m][1][-1] - D[m][1][l - k - 2]
    ans = max(ans, a + b)

print(ans)
n,l = map(int,raw_input().split())
s = []
for i in xrange(n) :
    s.append(raw_input())
s.sort()
t = ''
for j in xrange(n) :
    t += s[j]
print t    


### FIXED CODE ###

a,b,c = map(int,raw_input().split())
if max(a,b,c) == 7 and min(a,b,c) == 5 and a+b+c == 17 :
    print 'YES'
else :
    print 'NO'
n=int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(n):
    ans_list.append(a_list.index(i+1) + 1)
print(*ans_list)

### FIXED CODE ###

n=int(input())
if n % 2 == 0:
    print(0.5)
else:
    print((n+1)/2/n)
import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
M = 1000000007
N = int(input())
left = list(map(int, input().split()))
#assert len(left) == N
#assert left[0] == 0

counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    #assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    #assert sum(h) == N
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return res * len(set(itertools.permutations(h))) % M


print(solve())


### FIXED CODE ###

import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(sys.stdin.readline())
left = list(map(int, sys.stdin.read().split()))
counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    if sum(h) != N:
        return 0
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())
X=int(input())
year = 0
deposit = 100 
while  deposit < x :
    deposit = deposit*101//100
    year += 1
print(year) 


### FIXED CODE ###

X=int(input())
year = 0
deposit = 100 
while  deposit < X :
    deposit = deposit*101//100
    year += 1
print(year)
import collections

def answer(s):
    YES = 'YES'
    NO = 'NO'
    dic = collections.Counter(s)
    vals = sorted([v for k,v in dic.items()])
    _max = vals[0]
    print(_max
    if _max < 2:
        return YES
    if len(keys) == 2:
        return NO
    if (_max-1)*2 > sum(vals[1:]):
        return YES
    if (_max-1)*2 == sum(vals[1:]):
        if _max == vals[1]:
            return NO
        return YES
s = input()
print(answer(s))

### FIXED CODE ###

import collections

def answer(s):
    YES = 'YES'
    NO = 'NO'
    dic = collections.Counter(s)
    vals = sorted([v for k,v in dic.items()], reverse=True)
    if len(vals) == 1:
        if vals[0] == 1: return YES
        else: return NO
    elif len(vals) == 2:
        if vals[0] == 1 and vals[1] == 1: return YES
        else: return NO
    
    _max = vals[0]
    _sum = sum(vals[1:])
    if (_max-1)*2 <= _sum:
        if vals[1]-vals[2] > 1: return NO
        else: return YES
    return NO

s = input()
print(answer(s))
flg=True

if H==1 and W!=1:
    if B!=0:
        flg=False
    else:
        for i in range(A):
            mat[0][i]=1

    
elif H!=1 and W==1: 
    if A!=0:
        flg=False
    else:
        for i in range(B):
            mat[i][0]=1
else:
    for y in range(H):
        xs=0
        for x in range(W):

            if y_weight[x] < A and xs < B:
                mat[y][x] = 1
                y_weight[x]+=1
                xs += 1
        if xs!=B:
            flg=False
        
            
    for i in y_weight:
        if i!=A:
            flg=False
    
if flg:
    for row in mat:
        row=list(map(int, row))
        print("".join(list(map(str, row))))
else:
    print("No")

### FIXED CODE ###

import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W):
        mat[y][x]=1

for y in range(B,H):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))
import math
import sys
a,b,h,m = map(int,input().split())
h_ = h*30 + (m/60) * 30
m_ = m*6
alpha = h_ - m_
if 0 < alpha < 180:
    pass
elif alpha == 180:
    print(h+m)
    sys.exit()
elif alpha == 0:
    prinnt(abs(a-b))
    sys.exit()
else:
    alpha = 360 - alpha
ans_2 = a**2 + b**2 - 2 * b * a * math.cos(math.radians(alpha))
print(ans_2 ** 0.5)

### FIXED CODE ###

import math
import sys
a,b,h,m = map(int,input().split())
h_ = h*30 + (m/60) * 30
m_ = m*6
alpha = h_ - m_
if 0 < alpha < 180:
    pass
elif alpha == 180:
    print(a+b)
    sys.exit()
elif alpha == 0 or alpha == 360:
    print(abs(a-b))
    sys.exit()
else:
    alpha = 360 - alpha
ans_2 = a**2 + b**2 - 2 * b * a * math.cos(math.radians(alpha))
print(ans_2 ** 0.5)
N,K = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
print(p[0]+p[1]+p[2])

### FIXED CODE ###

N,K = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
ans = 0
for i,v in enumerate(p):
    ans += v
    if i == K - 1:
        print(ans)
        exit()
print(ans)
from math import sqrt, inf

a = []


def dis(n):
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0: a.append(i)


num = int(input())
dis(num)
ans = inf
for e in a:
    ans = min(ans, e + num // e - 2)
print(ans)


### FIXED CODE ###

def solve(n):
    ans = int(1e12)
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0 and i + n // i - 2 < ans:
            ans = i + n // i - 2
    return int(ans)


num = int(input())
print(solve(num))
n=input()
m=0
from itertools import combinations
b=combinations
a=b(map(int,input().split()),2)
for i,j in a:
    k=i*j
    m+=k
if m<=MOD:
    print(m)
else:
	MOD=10**9+7
    v=m%MOD
    print(v)

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
MOD = 10 ** 9 + 7

cumsum = [A[0]]
for i in range(1, N):
    cumsum.append(A[i] + cumsum[i - 1])

ans = 0
for i in range(N):
    ans += (A[i] * (cumsum[-1] - cumsum[i])) % MOD
    ans %= MOD

print(ans)