Harryxun/stf_run huggingface dataset:
import math

N = int(input())

cnt = 0
while(N>0):
  cnt += N%10
  N = int(N/10)
  #print(N)

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

### FIXED CODE ###

import math

#N = int(input())
N =list(input())
#print(N)
cnt = 0
for i in range(len(N)):
  cnt += int(N[i])
  #print(N)

if cnt%9 ==0:
	print('Yes')
else: print('No')
import heapq as hq

T = int(input())
for _ in range(T):
    N = int(input())
    camels = [list(map(int, input().split())) for _ in range(N)]
    base = 0
    camels_L = [[] for _ in range(N+1)]
    camels_R = [[] for _ in range(N+1)]
    # 左から詰めるラクダと右から詰めるラクダを仕分ける
for camel in camels:
    if camel[1] >= camel[2]:
        camels_L[camel[0]].append(camel[1] - camel[2])
        base += camel[2] # LとRの低いほうを加算
    else:
        # Rラクダは右から何列目かを考えるのでN - camel[0]と反転する
        camels_R[N - camel[0]].append(camel[2] - camel[1])
        base += camel[1] # LとRの低いほうを加算

diff = 0

# Lラクダについて考える
heap_camels = []
hq.heapify(heap_camels)
for i in range(1, N+1):
    # 左からi番目までが限度のラクダをまとめて追加
    for camel in camels_L[i]:
        hq.heappush(heap_camels, camel)
        # 左からi番目までに入りきらない場合に低いものから除外
    while len(heap_camels) > i:
        hq.heappop(heap_camels)
        # heapqに残ったものがすべての条件を満たしうれしさが最大
    diff += sum(heap_camels)

        # Rラクダについても同様
heap_camels = []
hq.heapify(heap_camels)
for i in range(1, N+1):
    for camel in camels_R[i]:
        hq.heappush(heap_camels, camel)
    while len(heap_camels) > i:
        hq.heappop(heap_camels)
diff += sum(heap_camels)
print(diff + base)


### FIXED CODE ###

def popcount(n):
    return bin(n).count('1')
    
N=int(input())
X=input()
xl=list(X)
X=int(X,2)
a=popcount(X)
#1が減った時
if a==1:
    xd=0
else:
    xd=X%(a-1)
#1が増えたとき
xi=X%(a+1)

for i in range(N):
    if xl[i]=='1':
        if a==1:
            print(0)
            continue
        else:
            k=pow(2,N-1-i,a-1)
            x=(xd-k)%(a-1)
    else:
        k=pow(2,N-1-i,a+1)
        x=(xi+k)%(a+1)
    count=1
    while x!=0:
        x%=popcount(x)
        count+=1
    print(count)
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1))

### FIXED CODE ###

from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,0))
def PrimeNumber(N):
    ans = list(range(2, N + 1))
    i = 0
    while ans[i] < N ** 0.5 + 1:
        j = 2
        temp = ans[i]
        while temp * j <= ans[-1]:
            if temp * j in ans:
                ans.remove(temp * j)
            j += 1
        i += 1
    return ans


N=int(input())

PN=PrimeNumber(N)
c=[0]*(N+1)

for i in range(2,N+1):
    temp=i
    for j in PN:
        while temp>0 and j<=i:
            if temp%j==0:
                c[j]+=1
                temp=temp//j
            else:
                break

ans=1
for i in PN:
    ans*=(c[i]+1)
    ans%=(10**9+7)

print(ans)

### FIXED CODE ###

def PrimeNumber(N):
    if N==2:
        ans=[2]
        return ans
    ans = list(range(2, N + 1))
    i = 0
    while ans[i] < N ** 0.5 + 1:
        j = 2
        temp = ans[i]
        while temp * j <= ans[-1]:
            if temp * j in ans:
                ans.remove(temp * j)
            j += 1
        i += 1
    return ans

N=int(input())

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

mod=10**9+7
PN=PrimeNumber(N)
P=[0]*(N+1)

for i in range(2,N+1):
    temp=i
    for j in PN:
        if temp<j:
            break
        cnt=0
        while temp%j==0:
            cnt+=1
            temp=temp//j
        P[j]+=cnt

ans=1

for i in range(1,N+1):
    if P[i]!=0:
        ans=(ans*(P[i]+1))%mod
print(ans)
import numpy
N, M, C = map(int, input().split())
b = numpy.array([i for i in map(int, input().split())])                                                        
A = numpy.array([[0]*M]*N)
for i in range(N):
    A[i] = [i for i in map(int, input().split())]

print(sum((numpy.matmul(A, b) + C) > 0))

### FIXED CODE ###

N, M, C = map(int, input().split())
b = [i for i in map(int, input().split())]
A = [0]*N
for i in range(N):
    A[i] = [i for i in map(int, input().split())]

count = 0 
for r in range(N):
    tmp = 0 
    for c in range(M):
        tmp += A[r][c] * b[c]
    tmp += C
    if tmp > 0: count += 1                                                                                     
    
print(count)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a,b,c,d,e]

lst2 = []

for x in lst:
    amari = x % 10
    if amari == 0:
        pass
    else:
        lst2.append(10 - amari)

lst2.remove(max(lst2))
print(sum(lst)+sum(lst2))

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a,b,c,d,e]

lst2 = []

for x in lst:
    amari = x % 10
    if amari == 0:
        pass
    else:
        lst2.append(10 - amari)

if not lst2:
    pass
else:
    lst2.remove(max(lst2))
print(sum(lst)+sum(lst2))
import math
N, K = [int(i) for i in input().split()]
n = [K]
k = K
while True:
    k /= 2
    n.append(math.ceil(k))
    if math.ceil(k)==1:break

n.reverse()
ma=[(1/2)**i for i in range(len(n))]
t=[]
m=len(n)
for i,(j,k) in enumerate(zip(n[1:],n)):
    t+=[ma[m-i-1]]*(j-k)
if N>K:t+=[1]*(N-K+1)
else: t=t[:N]
print("{:9f}".format(math.fsum(t)/len(t)))

### FIXED CODE ###

import math
N,K = map(int, input().split())
if K == 1:
    print(1)
else:
    P = max(0,(N-(K-1))/N)
    t = 0
    for i in range(1,min(N+1,K)):
        foo = math.log2(K/i)
        x=math.ceil(foo)
        t+=(1/2)**x
    P+=t*(1/N)
    print(P)
# スペース区切りの整数の入力
p, q, r = map(int, raw_input().split())

# 出力
Print(p+q+r-max(p, q, r))

### FIXED CODE ###

p,q,r=map(int,input().split())
print(p+q+r-max(p,q,r))
L, R = map(int, input().split())

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    amari = [i % 2019 for i in range(L, R + 1)]
    l = len(amari)
    for i in range(l + 1):
        a = amari[i]
        for j in range(i + 1, l + 1):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)

### FIXED CODE ###

L, R = map(int, input().split())

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    amari = [i % 2019 for i in range(L, R + 1)]
    l = len(amari)
    for i in range(l):
        a = amari[i]
        for j in range(i + 1, l):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)
N, M, X = map(int, input().split())
Ca = [list(map(int, input().split())) for _ in range(N)]
pattern = []
for i in range(2**N):
    lis = []
    for j in range(N):
        if ((i>>j)&1):
            lis.append(Ca[j])
    pattern.append(lis)

cnt = []
for i in range(2**N):
    g = [0] * (M+1)
    for j in range(len(pattern[i])):
        for k in range(M+1):
            g[k] += pattern[i][j][k]
            x = g[1:M]
    if min(x) < X:
        continue
    else:
        cnt.append(g[0])
if len(cnt) ==0:
    print(-1)
else:
    print(min(cnt))

### FIXED CODE ###

N, M, X = map(int, input().split())
Ca = [list(map(int, input().split())) for _ in range(N)]
pattern = []
for i in range(2**N):
    lis = []
    for j in range(N):
        if ((i>>j)&1):
            lis.append(Ca[j])
    pattern.append(lis)

cnt = []
for i in range(2**N):
    g = [0] * (M+1)
    for j in range(len(pattern[i])):
        for k in range(M+1):
            g[k] += pattern[i][j][k]
    if M==1 and g[1]< X:
        continue
    elif M>1 and min(g[1:M+1]) < X:
        continue
    else:
        cnt.append(g[0])
if len(cnt) ==0:
    print(-1)
else:
    print(min(cnt))
n,k = map(int,input().split())
a = list(map(int,input().split()))
from math import gcd
g = a[0]
for i in a[1:]:
    g = gcd(g,i)
if k<=max(a) and k%g==0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
from fractions import gcd
g = a[0]
for i in a[1:]:
    g = gcd(g,i)
if k<=max(a) and k%g==0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
A, B = input().split()
print(int(A)*float(B*100)//100)


### FIXED CODE ###

A, B = input().split()
A = int(A)
B1,B2 = B.split(".")
B = 100*int(B1)+int(B2)
print((A*B)//100)
n, m =map(int,input().split())
l = [{int(x) for x in input().split()}]
ans = 0
for _ in range(m-1):
    a = {int(x) for x in input().split()}
    for j, s in enumerate(l):
        if s & a:
            l[j] |= a
            break
    else:
        l.append(a)
for s in l:
    ans = max(ans, len(s))
print(ans)


### FIXED CODE ###

class UnionFind:
    #par[x]でxの親のID，xが根ならその木のサイズに―をつけたもの
    def __init__(self, n):
        #全て根として初期化
        self.par = [-1] * n
    
    #xの根を返す
    def root(self, x):
        #xが根なら終了
        if self.par[x] < 0:
            return x
        #そうでないならxの親について調べる
        self.par[x] = self.root(self.par[x])    #xの根が親になるように更新
        return self.par[x]

    #xとyを結合
    def union(self, x, y):
        x = self.root(x)
        y = self.root(y)
        #xとyが同じ根を持つ(＝同じ木に属する)なら終了
        if x == y:
            return
        #サイズの大きい木に小さい木を結合
        if self.par[x] > self.par[y]:   #xが大きくなるよう交換
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x
    
    #xのサイズを返す
    def size(self, x):
        return -1 * self.par[self.root(x)]


#main
n, m = map(int, input().split())
uf = UnionFind(n)
#Union-FInd木を作る
for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)      #1からではなく0からに
#サイズが最大のものを探す
ans = 0
for i in range(n):
    ans = max(ans, uf.size(i))
print(ans)
n = input()

INFTY = 10000000

color = [0 for i in range(n)]
M = [[0 for i in range(n)] for i in range(n)]
d = [10000000 for i in range(n)]
p = [-1 for i in range(n)]

def MST():
  d[0] = 0
  p[0] = -1

  while True:
    cost = INFTY
    for i in range(n):
      if color[i] != 1 and d[i] < cost:
        cost = d[i]
        u = i

    if cost == INFTY:
      break
    color[u] = 2

    for v in range(n):
      if color[v] != 2 and M[u][v] != INFTY:
      if M[u][v] < d[v]:
        d[v] = M[u][v]
        p[v] = u
        color[v] = 1:

  sum = 0
  for i in range(n):
    if p[i] != -1:
      sum += M[i][p[i]] 
  return sum

for i in range(n):
  G = map(int, raw_input().split())
  for j in range(n):
   if G[j] == -1:
     M[i][j] = INFTY
   else:
     M[i][j] = G[n]:

print MST()

### FIXED CODE ###

n = input()

INFTY = 10000000

color = [0 for i in xrange(n)]
M = [[INFTY for i in xrange(n)] for i in xrange(n)]
d = [INFTY for i in xrange(n)]
p = [-1 for i in xrange(n)]

def MST():
  d[0] = 0

  while True:
    cost = INFTY
    for i in xrange(n):
      if color[i] != 2 and d[i] < cost:
        cost = d[i]
        u = i

    if cost == INFTY:
      break
    
    color[u] = 2

    for v in xrange(n):
      if color[v] != 2 and M[u][v] != INFTY and M[u][v] < d[v]:
        d[v] = M[u][v]
        p[v] = u
        color[v] = 1

  sum = 0
  for i in xrange(n):
    if p[i] != -1:
      sum += M[i][p[i]]
  return sum

for i in xrange(n):
  G = map(int, raw_input().split())
  for j in range(n):
   if G[j] != -1:
     M[i][j] = G[j]

print MST()
x, k, d = map(int, input().split(" "))

def y(l): return abs(x + l * d - (k - l) * d)

lf = max(0, (k - x / d) / 2)
l = int(lf)
if lf - l > 0 and l + 1 <= k:
    print(min(y(l), y(l + 1)))
else:
    print(y(l))


### FIXED CODE ###

print({
    "SSS": 0,
    "SSR": 1,
    "SRS": 1,
    "SRR": 2,
    "RSS": 1,
    "RSR": 1,
    "RRS": 2,
    "RRR": 3,
}[input()])
h, w, k = map(int, input().split())
mark = [input() for _ in range(h)]
ans = 0

for bit_h in range(1 << h):
  i_list = []
  for i in range(h):
    if bit_h & 1:
      i_list.append(i)
    bit_h >>= 1
  for bit_w in range(1 << w):
    count = 0
    j_list = []
    for j in range(w):
      if bit_w & 1:
        j_list.append(bit_w & 1)
      bit_w >>= 1
    for i in i_list:
      for j in j_list:
        if mark[i][j] = '#':
          count += 1
    if count == k:
      ans += 1
print(ans)

### FIXED CODE ###

h, w, k = map(int, input().split())
mark = [input() for _ in range(h)]
ans = 0

for bit_h in range(1 << h):
  i_list = []
  for i in range(h):
    if bit_h & 1:
      i_list.append(i)
    bit_h >>= 1
  for bit_w in range(1 << w):
    count = 0
    j_list = []
    for j in range(w):
      if bit_w & 1:
        j_list.append(j)
      bit_w >>= 1
    for i in i_list:
      for j in j_list:
        if mark[i][j] == '#':
          count += 1
    if count == k:
      ans += 1
print(ans)
*t, = map(int, open(0).read().split())
m = min([i%10 for i in t if i%10])
print(sum([-(-j // 10) for j in t])*10-10+m)

### FIXED CODE ###

*t, = map(int, open(0).read().split())
try:
    m = 10 - min([i%10 for i in t if i%10])
except ValueError:
    m = 0
print(sum([-(-j // 10) for j in t])*10 - m)
a, b = map(int, input().split())

if a =< 5:
  print(0)
elif a <= 12:
  print(int(b / 2))
else:
  print(b)

### FIXED CODE ###

a, b = map(int, input().split())
 
if a <= 5:
  print(0)
elif a <= 12:
  print(int(b / 2))
else:
  print(b)
import sys
def input():
    return sys.stdin.readline()[:-1]
class uf:
    def __init__(self,n):
        self.n=n
        self.l=[-1]*n
    def ro(self,n):
        if self.l[n]<0:
            return n
        r=self.ro(self.l[n])
        self.l[n]=r
        return r
    def me(self,a,b):
        ra=self.ro(a)
        rb=self.ro(b)
        if ra!=rb:
            self.l[ra]+=self.l[rb]
            self.l[rb]=ra
    def size(self,n):
        return -self.l[self.ro(n)]
    def sa(self,a,b):
        return self.ro(a)==self.ro(b)
N,M,K=map(int,input().split())
u=uf(N)
l=[-1]*N
for i in range(M):
    A,B=map(lambda x: int(x)-1,input().split())
    u.me(A,B)
    l[A]-=1
    l[B]-=1
for i in range(N):
    l[i]+=u.size(i)
for i in range(K):
    C,D=map(lambda x: int(x)-1,input().split())
    if u.sa(C,D):
        l[C]-=1
        l[D]-=1
print(*l)


### FIXED CODE ###

import sys
N,M,K=map(int,input().split())
s=[[]for i in range(N)]
tn=[0]*N
sys.setrecursionlimit(200000)
for i in range(M):
    a,b=map(int,input().split())
    s[a-1].append(b)
    s[b-1].append(a)
    tn[a-1]+=1
    tn[b-1]+=1
l=[None]*N
def hu(n,t):
    l[n]=t
    for i in s[n]:
        if l[i-1]==None:
            l[i-1]=t
            hu(i-1,t)
t=0
for i in range(N):
    if l[i]==None:
        hu(i,t)
        t+=1
c=[0]*t
for i in l:
    c[i]+=1
for i in range(K):
    a,b=map(int,input().split())
    if l[a-1]==l[b-1]:
        tn[a-1]+=1
        tn[b-1]+=1
for i in range(N):
    print(c[l[i]]-tn[i]-1,end=" ")
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

last_ana = int(input())
blocks = [last_ana]

for _ in range(1, m):
    ana = int(input())
    blocks.append(ana - last_ana - 1)
    last_ana = ana

blocks.append(n - last_ana)

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)

    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % BIGNUM)

    ans = 1
    for num in blocks:
        ans = ans * c[num - 1]

print(ans % BIGNUM)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

if m > 0:
    last_ana = int(input())
    blocks = [last_ana]

    for _ in range(1, m):
        ana = int(input())
        blocks.append(ana - last_ana - 1)
        last_ana = ana
    blocks.append(n - last_ana)
else:
    blocks = [n + 1]

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)
    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % BIGNUM)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans = (ans * c[num - 1]) % BIGNUM
        if ans == 0:
            break

print(ans)
N = int(input())
S = input()
res = 0
x = 0
for i in range(N):
  if S[i] == 'I':
    x += 1
  else:
    x -= 1
  res = max(res, x)
return res

### FIXED CODE ###

N = int(input())
S = input()
res = 0
x = 0
for i in range(N):
  if S[i] == 'I':
    x += 1
  else:
    x -= 1
  res = max(res, x)
print(res)
n = int(raw_input())
s = ''

for i in range(1, n+1):
    if i%3 == 0:
        s = s + ' ' + str(i)
    elif i%10 == 3:
        s = s + ' ' + srt(i)
print s

### FIXED CODE ###

n = int(raw_input())
i = 1
print "",

while i <= n:
  if i%3 == 0:
      print i,
  else:
      I = str(i)
      for j in range(len(I)):
          if I[j] == '3':
              print I,
              break
  i += 1
d,n=map(int,input().split())
print((n+n//100)*(100**d))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    while a[i] % 2 == 0:
        a[i] //= 2
        ans += 1
print(ans)
A, B, K = list(map(int, input().split()))

S = [1]

for i in range(2,min(A,B)):
    if A % i == 0 and B % i == 0:
        S.append(i)

print(S[K-1])

### FIXED CODE ###

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

S = [1]

for i in range(2,min(A+1,B+1)):
    if A % i == 0 and B % i == 0:
        S.append(i)

S.sort(reverse=True)

print(S[K-1])
n = int(raw_input())
A = map(int, raw_input().split())
A.sort()

q = int(raw_input())
M = map(int, raw_input().split())
M.sort()

result = []
for i in range(q):
    result.append('no')

for i in range(n-1):
    sum_n = A[i]
    M_clone = M[:]
    flag = False
    for j in range(n-1-i):
        if flag:
            break
        sum_n = sum_n + A[i+1+j]
        for k in range(len(M)):
            if M_clone[k] == sum_n:
                result[k] = 'yes'
                M.pop(k)
                flag = True
                break
            elif M_clone[k] < sum_n:
                M_clone.pop(k)

for i in result:
    print(i)

### FIXED CODE ###


n = int(raw_input())
A = map(int, raw_input().split())

q = int(raw_input())
M = map(int, raw_input().split())

result = []
for i in range(q):
    result.append('no')

def adder(axis = 0, nums = [0], M = [0], q = 0):
    for i in range(q):
        if M[i] == axis:
            result[i] = 'yes'
    length = len(nums)
    if length != 0:
        for i in range(length):
            sum_n = axis + nums[i]
            adder(sum_n, nums[i+1:], M, q)

for i in range(n):
    adder(A[i], A[i+1:], M, q)

for i in result:
    print(i)
N, W = map(int, input().split())
weight = []
value = []
for i in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)
dp = [[0 for _ in range(W)] for _ in range(N)]
for i in range(N):
    for j in range(W+1):
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
        if j - weight[i] >= 0:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-weight[i]]+value[i])
print(dp[N][W])



### FIXED CODE ###

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

dp = [[0 for _ in range(W+1)] for _ in range(N+1)]
weight = [0]
value = [0]
for i in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)

for i in range(N):
    i += 1
    for sum_w in range(W+1):
        # i 番目の品物を選ぶ場合
        if sum_w >= weight[i]:
            dp[i][sum_w] = max(dp[i][sum_w], dp[i-1][sum_w - weight[i]] + value[i])
        # i 番目の品物を選ばない場合
        dp[i][sum_w] = max(dp[i][sum_w], dp[i-1][sum_w])

print(dp[N][W])
n=int(input())
T=list(map(int,input()))
m=int(input())
for i in range(m):
    p,k=map(int,input().split())
    T[p-1]=k
    print(sum(T))  

### FIXED CODE ###

n=int(input())
T=list(map(int,input().split()))
m=int(input())
for i in range(m):
    p,k=map(int,input().split())
    tmp=T[p-1]
    T[p-1]=k
    print(sum(T))
    T[p-1]=tmp
def resolve():
    n = int(input())
    s = 0
    for _ in range(n):
        x, u = input().split()
        if u == 'BTC':
            s += float(x) * 380000
        else:
            s += float(x) * 1
    print(s)
resole()

### FIXED CODE ###

def resolve():
    n = int(input())
    s = 0
    for _ in range(n):
        x, u = input().split()
        if u == 'BTC':
            s += float(x) * 380000
        else:
            s += float(x) * 1
    print(s)
resolve()
import sys

a=sys.argv[1]
b=sys.argv[2]

def int(a,b):
    return a*2+b*2,a*b

print(int(a,b))

### FIXED CODE ###

s = input().split()
a=int(s[0])
b=int(s[1])
print(a*b,a*2+b*2)
n = int(input())
s = input()
count = 0
for i in range(n):
    if s[i] == "A":
        if s[i+ 1] == "B":
            if s[i + 2] == "C":
                count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = input()
count = 0
for i in range(n - 2):
    if s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C":count += 1
print(count)
#Bad_Beast
n=int(input())
if n==111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
print(res)    
        
    

### FIXED CODE ###

#Bad_Beast
n=int(input())
if n>=100 and n<=111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
#print(res)
N,K = map(int, input().split())
memo = (N-1)*(N-2)//2
if K <= memo:
    print(((N-1) + memo - K)
    for i in range(2,N+1):
        print("1 " + str(i))
    tmp = 1
    i = 1
    j = i + 1
    while tmp < memo-K:
        while j <= N and tmp < memo-K:
            print(str(i) + " " + str(j))
            j += 1
            tmp += 1
        i += 1
        j = i + 1
else:
    print(-1)

### FIXED CODE ###

N,K = map(int, input().split())
memo = (N-1)*(N-2)//2
if K <= memo:
    print((N-1) + memo - K)
    for i in range(2,N+1):
        print(1,i)
    cnt = 0
    i = 2
    j = i + 1
    while cnt < memo-K:
        while j <= N and cnt < memo-K:
            print(i,j)
            j += 1
            cnt += 1
        i += 1
        j = i + 1
else:
    print(-1)
a, b, c = map(int, input().split())
if a, b, c == (5, 5, 7):
  print(YES)
elif a, b, c == (5, 7, 5):
  print(YES)
elif a, b, c == (7, 5, 5):
  print(YES)
else:
  print(NO)

### FIXED CODE ###

a, b, c = map(int, input().split())
if (a, b, c) == (5, 5, 7):
  print("YES")
elif (a, b, c) == (5, 7, 5):
  print("YES")
elif (a, b, c) == (7, 5, 5):
  print("YES")
else:
  print("NO")
import math
a,b,x=map(int,input().split())
x_2d = x/a
if x/a > (a*b)/2:
    print(90-math.degrees(math.atan(a/(2*b-2*x/(a*a)))))
else:
    print(math.degrees(math.atan(b/(2*x/(a*b)))))

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
x_2d = x/a
if a*a*b == x:
    print(0)
    exit()
if x/a > (a*b)/2:
    print(90-math.degrees(math.atan(a/(2*b-2*x/(a*a)))))
else:
    print(math.degrees(math.atan(b/(2*x/(a*b)))))
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for i in range(m)]

C = [[0] * n for i in range(l)]

for i in range(l):
    for j in range(n):
        C[i][j] = str(sum(A[i][k] * B[k][j] for k in range(m)))

for i in range(l):
    print(' '.join(C[i]))

### FIXED CODE ###

n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for i in range(m)]

C = [[0] * l for i in range(n)]

for i in range(n):
    for j in range(l):
        C[i][j] = str(sum(A[i][k] * B[k][j] for k in range(m)))

for i in range(n):
    print(' '.join(C[i]))
abc = sorted(list(map(int, input().split())))
k = int(input())

print(a + b + c * (2 ** k))

### FIXED CODE ###

abc = sorted(list(map(int, input().split())))
k = int(input())

print(abc[0] + abc[1] + abc[2] * (2 ** k))
a= int(input())
b = list(map(int, input().split()))
answe = True


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[len(a-1)] < b[len(a-2)]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

min = 0
for i in b:
    if min == i:
        continue
    if min > i:
        print("No")
        exit()
    if min < i :
        min = i-1



print("Yes")