Harryxun/stf_run huggingface dataset:
import sys

sys.setrecursionlimit(100000)

def steps(n):
    if memo[n] != -1:
        return memo[n]
    if n-1 not in broken:
        one = memo[n-1] if memo[n-1] != -1 else steps(n-1)
    else:
        one = 0
        
    if n-2 not in broken:
        two = memo[n-2] if memo[n-2] != -1 else steps(n-2)
    else:
        two = 0
    
    memo[n] = one + two
    return memo[n]

n, m = map(int, input().split())
broken = [int(input()) for i in range(m)]
memo = [-1 for i in range(n+1)]
memo[0] = 1
memo[1] = 1

print(steps(n) % (10**9+7))

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

def steps(n):
    if memo[n] != -1:
        return memo[n]
    
    one = memo[n-1] if memo[n-1] != -1 else steps(n-1)    
    two = memo[n-2] if memo[n-2] != -1 else steps(n-2)

    memo[n] = one + two
    return memo[n]

n, m = map(int, input().split())
broken = [int(input()) for i in range(m)]
memo = [-1 for i in range(n+1)]
memo[0] = 1
memo[1] = 1
for b in broken:
    memo[b] = 0

print(steps(n) % (10**9+7))
n, m = list(map(int, input().split()))
if m > 0:
  a = [int(input()) for i in range(m)]
else:
  a = []

if n = 1:
  pat = 1
else:
  pt = [1]
  if (1 in a):
    pt.append(0)
  else:
    pt.append(1)

  for i in range(2, n + 1):
    if (i in a):
      pt.append(0)
    else:
      if (i-1 in a):
        pt.append(pt[i-2])
      else:
        pt.append(pt[i-1] + pt[i-2])

pat = (pt[-1] % 1000000007)
print(pat)


### FIXED CODE ###

n, m = list(map(int, input().split()))
if m > 0:
  a = set([int(input()) for i in range(m)])
else:
  a = set([])

if n == 1:
  pat = 1
else:
  pt = [1]
  if (1 in a):
    pt.append(0)
  else:
    pt.append(1)

  for i in range(2, n + 1):
    if (i in a):
      pt.append(0)
    else:
      if (i-1 in a):
        pt.append(pt[i-2])
      else:
        pt.append(pt[i-1] + pt[i-2])

  pat = (pt[-1] % 1000000007)
print(pat)
N, a, b = map(int, input().split())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
X = 2 * 10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, X + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ax = cmb(N, a, mod)
bx = cmb(N, b, mod)

print((pow(2, N) - ax - bx - 1)%(10**9 + 7))

### FIXED CODE ###

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

MOD = 10**9+7

def modcmb(n, r, m):
    x = 1
    y = n
    for i in range(2,r+1):
        x *= i
        x %= MOD
        y *= n-i+1
        y %= MOD
    return y * pow(x, m-2, m) % m

ans = pow(2, N, MOD) - modcmb(N, a, MOD) - modcmb(N, b, MOD) - 1
print(ans % MOD)
n=int(input())
A=list(map(int,input().split()))
c=0
while(all([a%2==0 for a in A])):
    A = list(map(lambda i:i//2, A))
    c+=1
print(c)

### FIXED CODE ###

print(input().count("1"))
a, b = [int(i) for i in input().split()]
if a < b:
    print("a < b")

    elif ???:
    print("a > b")

    else:
    print("a == b")

### FIXED CODE ###

a, b = [int(i) for i in input().split()]
if a < b:
    print("a < b")

elif a > b:
    print("a > b")

else:
    print("a == b")
n = int(input())
x = 0
for i in range(0, n+1, 4):
    if (n - i) % 7 == 0:
        x = 1
print(('No','Yes')[x])

### FIXED CODE ###

n, k = map(int, input().split())
print(0 if n % k == 0 else 1)
n ,a,b= map(int,input().split())
cur = (b-a-1)
if cur %2==0:
    left = b-1
    right = n-a
    print(min(left,right))
else:
    cur +=1
    print(cur//2)

### FIXED CODE ###

n ,a,b= map(int,input().split())
cur = (b-a-1)
if cur %2==0:
    left = a-1
    right = n-b
    if b-a == 1:
        print(min(n-a,b-1))
    else:
        cur =0
        if left<right:
            cur = left
            a = 1
            b -= left
        else:
            cur = right
            a+=right
            b=n
        if b-a ==1:
            print(cur+1)
        else:
            need = b-a
            if need %2 ==0:
                need+=2
            else:
                need+=1
            print(cur+(need)//2)
else:
    cur +=1
    print(cur//2)
a, b = gets.chomp.split(" ").to_i
if a < b
    puts "a < b"
elsif a > b
    puts "a > b"
else
    puts "a == b"
end

### FIXED CODE ###

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

if a > b:
    print "a > b"
elif a < b:
    print "a < b"
else:
    print "a == b"
N,M = map(int,input().split())
A = list(map(int,input().split()))
sm = sum(A)
jud = sm/(4*M)

b = 0
for i in A:
    if i > jud:
        b = b+1
if b >= M:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

x,y,z = map(int,input().split())
print(z,' ',x,' ',y)
n,m=map(int,input().split())
 
WA=[0]*n
AC=[0]*n
 
for i in range(m):
    problem,status=input().split()
    problem=int(problem)
 
    if status=='WA':
        if AC[problem-1]==1:
            continue
        else:
            WA[problem-1]+=1
    elif status=='AC':
        AC[problem-1]=1

for i in range(n):
    if AC[i]==0:
        WA[i]=0
print(sum(AC),sum(WA))


### FIXED CODE ###

character=input()


print(chr(ord(character)+1))
time = []
total = 0
for _ in range(5):
    t = int(input())
    if t % 10 == 0:
        total += t
    else:
        total += (t//10+1)*10
        time.append(t)

last = min(time, key=lambda x: int(str(x)[-1]))

print(total - 10+last%10)

### FIXED CODE ###

time = []
total = 0
for _ in range(5):
    t = int(input())
    if t % 10 == 0:
        total += t
    else:
        total += (t//10+1)*10
        time.append(t)
if time:
    last = min(time, key=lambda x: int(str(x)[-1]))
    print(total - 10+last%10)
else:
    print(total)
while True:
    n=input()
    m=input()
    if n==0:break
    S,L=set(),[]
    for i in range(m):
        a,b=map(int,raw_input().split())
        if a==1:
            S.add(b)
        elif b==1:
            S.add(a)
        else:
            L.append((a,b))
    for i in S:
        for s in L:
            if i in s:
                S=S.union(s)
    print len(S)

### FIXED CODE ###

while True:
    n=raw_input()
    if n in "0":break
    try:
        m=input()
    except SyntaxError:
        break
    S,L=set(),[]
    for i in range(m):
        a,b=map(int,raw_input().split())
        if a==1:
            S.add(b)
        elif b==1:
            S.add(a)
        else:
            L.append((a,b))
    for i in S:
        for s in L:
            if i in s:
                S=S.union(s)
    print len(S)
k = int(input())
s = list(input())
if k == len(s):
  print(''.join(s))
else:
  l = []
  for i in range(k):
    l.append(s[i])
  l.append('...')
  m = ''.join(l)
  print(m)
  
    

### FIXED CODE ###

k = int(input())
s = list(input())
if k >= len(s):
  print(''.join(s))
else:
  l = []
  for i in range(k):
    l.append(s[i])
  l.append('...')
  m = ''.join(l)
  print(m)
import numpy as np
import pandas as pd
N=int(input())
S=input()

S_list = pd.Series([x for x in S])
r = sum(S_list == "R")
g = sum(S_list == "G")
b = sum(S_list == "B")
 
ans = r * g * b
 
for i in range(N):
  for k in [N - k_ - 1 for k_ in range(N)]:
    tar_j = i + k
    if (tar_j > 2 * i) & (tar_j < 2 * k):
      if np.mod(tar_j, 2) == 0:
        j = int(tar_j / 2)
        s = S[i] + S[j] + S[k]
        if ("R" in s) & ("G" in s) & ("B" in s):
          ans -= 1
    else:
      break
print(ans)


### FIXED CODE ###


#S = "RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB"# * 1000
#N = len(S)

N=int(input())
S=input()
r = len(S.replace("G", "").replace("B", ""))
g = len(S.replace("R", "").replace("B", ""))
b = N - r - g
 
ans = r * g * b
 
is_break = False
for i in range(N):
    for j in range(i, int((N+i)/2 + 1)):
        k = 2 * j - i
        if k < N:
            s = S[i] + S[j] + S[k]
            if ("R" in s) & ("G" in s) & ("B" in s):
                    ans -= 1

print(ans)
a,b,c = map(int,input())

if a = b != c or b = c != a or c = a != b:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

if a == b != c or b == c != a or c == a != b:
    print('Yes')
else:
    print('No')
N = input()
V = list(map(int, input().split()))
V = sorted(V)
value = V.pop(-1)
while value:
    value += V.pop(-1)
print(value)

### FIXED CODE ###


N = input()
V = list(map(int, input().split()))
V = sorted(V)
value = V.pop(0)
while V:
    value =(value + V.pop(0))/2
print(value)
N,K,M = map(int,input().split())

A = []

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

S = sum(A)
Score = M * N

n = Score - S

if n >=0 and n <= 100:
    print(n)
elif n > 100:
    print('-1')
else:
    print(0)


### FIXED CODE ###

x = input()
l = [chr(i) for i in range(97, 97+26)]

for i in range(26):
    if l[i]== x:
        k = i
        
print(l[k+1])
n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
b=[int(input())for i in range(m)]
[print(sum([j*k for j,k in zip(a[i],b])) for i in range(n)]


### FIXED CODE ###

n,m=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
b=[int(input())for _ in range(m)]
[print(sum([j*k for j,k in zip(a[i],b)]))for i in range(n)]
def fill0(s,x,y):
	if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
		A[y][x] = 0
		fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
	H,W = map(int,raw_input().split())
	if H == 0: break
	A = [list(raw_input()) for i in range(H)]
	ans = 0
	for y in range(H):
		for x in range(W):
			if A[y][x] in ["#","@","*"]:
				fill0(A[y][x],x,y)
				ans += 1
	print 0

### FIXED CODE ###

import sys
sys.setrecursionlimit(20000)
def solve(h,w,count,c):
    if 0 <= h < H and 0 <= w < W and A[h][w] == c:
        A[h][w] = count
        for dh,dw in zip([1,0,-1,0],[0,1,0,-1]):
            solve(h+dh,w+dw,count,c)
while 1:
    H,W = map(int,raw_input().split())
    if H == W == 0: break
    A = [list(raw_input()) for _ in range(H)]
    count = 0
    for h in range(H):
        for w in range(W):
            if type(A[h][w]) is not int:
                solve(h,w,count,A[h][w])
                count += 1
    print count
N = int(input())

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

c = 0

for i in range(N-1):
  for j in range(int(i)+1, N):
    d = A[i] % (10**9+7)
    e = A[j] % (10**9+7)
    f = (d*e) % (10**9+7)
    c += f
    

c = c % (10**9+7)

print(c)

### FIXED CODE ###

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

c = d / s

if t>=c:
  print('Yes')
elif t<c:
  print('No')
ls_ac = [0] * n
ls_ng = [0] * n
ac = 0
ng = 0


for i in range(m):
    p = int(ls[i][0])
    if ls[i][1] == "AC":
        if ls_ac[p - 1] == 0:
            ac += 1
            ng += ls_ng[p - 1]
            ls_ac[p - 1] = 1
    elif ls[i][1] == "WA":
        if ls_ac[p - 1] == 0:
            ls_ng[p - 1] += 1

print(ac, ng)

### FIXED CODE ###

n, m = map(int, input().split())
ls = [[_ for _ in input().split()] for _ in range(m)]

ls_ac = [0] * n
ls_ng = [0] * n
ac = 0
ng = 0


for i in range(m):
    p = int(ls[i][0])
    if ls[i][1] == "AC":
        if ls_ac[p - 1] == 0:
            ac += 1
            ng += ls_ng[p - 1]
            ls_ac[p - 1] = 1
    elif ls[i][1] == "WA":
        if ls_ac[p - 1] == 0:
            ls_ng[p - 1] += 1

print(ac, ng)
a,b,c=map(int,input().split())
s=sum(a,b,c)
if s>=22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

a,b,c=map(int,input().split())
s=a+b+c
if s>=22:
  print("bust")
else:
  print("win")
a, b = int(input())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")

### FIXED CODE ###

a, b = map(int, input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
N, M = map(int,input().split())
array = sorted(list(map(int,input().split())))
convert = [list(map(int,input().split())) for _ in range(M)]
convert.sort(key=lambda x: x[1])
convert.reverse()
i = 0
for j in range(M):
  #array.sort()
  print("j=",j)
  start = 0
  while (array[i] < convert[j][1]) & (start < convert[j][0]):
    array[i] = convert[j][1]
    print(array)
    i += 1
    start += 1
print(sum(array))



### FIXED CODE ###

N, M = map(int,input().split())
array = sorted(list(map(int,input().split())))
convert = [list(map(int,input().split())) for _ in range(M)]
convert.sort(key=lambda x: x[1])
convert.reverse()
i = 0
for j in range(M):
  #array.sort()
  start = 0
  while (array[i] < convert[j][1]) & (start < convert[j][0]):
    array[i] = convert[j][1]
    #print(array)
    i += 1
    start += 1
    if i == N:
      break
  if i == N:
    break

print(sum(array))
import bisect

N = int(input())
A = [int(input()) for i in range(N)]

ans = 1
X = [-A[0]]
for i in range(1,N):
    if -X[ans-1] >= A[i]:
        X.append(-A[i])
        ans += 1
    else:
        pos = bisect.bisect_left(X,-A[i])
        X[pos] = -A[i]

print(ans)


### FIXED CODE ###

r = int(input())
print(3*r**2)
import sys

def main(args):
    # given = [(i, int(args[i])) for i in range(len(args))]
    # ans = sorted(given, key=lambda elm: elm[1])
    # print(ans[0][1]+1)

    ans = [1,2,3,4,5]
    given = [int(i) for i in args]

    for i in range(len(ans)):
        if ans[i] != given[i]:
            print(ans[i])
            return 0

main(sys.argv[1:])

### FIXED CODE ###

#!python
given = [int(i) for i in input().split()]
ans = [1,2,3,4,5]

for i in range(len(ans)):
    if ans[i] != given[i]:
        print(ans[i])
        break
from collections import Counter

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

L=[]
for i in range(N):
    A=list(map(int,input().split()))
    L.append(A)
    
OUTD=dict()
S=[0 for i in range(M)]

ANS=1000
for i in range(M):
    B=[0 for _ in range(N)]
    for j in range(N):
        for k in range(S[j],M):
            '''if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break'''
            if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break
    X=Counter(B).most_common()[0]
    if X[1]<ANS:
        ANS=X[1]
    OUTD[X[0]]=1
    #print(ANS,B,OUTD)
print(ANS)

### FIXED CODE ###

from collections import Counter

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

L=[]
for i in range(N):
    A=list(map(int,input().split()))
    L.append(A)
    
OUTD=dict()
S=[0 for i in range(N)]

ANS=1000
for i in range(M):
    B=[0 for _ in range(N)]
    for j in range(N):
        for k in range(S[j],M):
            if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break
    X=Counter(B).most_common()[0]
    if X[1]<ANS:
        ANS=X[1]
    OUTD[X[0]]=1
    #print(ANS,B,OUTD)
print(ANS)
import math 
n=int(input())
print(math.ceil(n/2)

### FIXED CODE ###

import math 
n=int(input())
print(math.ceil(n/2))
n = int(input())

az = ['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']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new_l = l + az[i]
      		out_list.append(new_l)
	return out_list

line = ["a"]

for _ in range(n-1):
  line = norm(1,line)
  
for l in line:
  print(l)


### FIXED CODE ###

N = int(input())
az = ['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']
def norm(n, in_list):
	out_list = []
	for line in in_list:
		for i in range(len(set(line))+1):
			new_line = line + az[i]
			out_list.append(new_line)
	return out_list
init_line = ['a']
for _ in range(N-1):
	init_line = norm(1, init_line)
for line in init_line:
	print(line)
N,M=map(int,input().split())
store=[]
for _ in range(M):
  store.append([map(int,input().split())])
sorted(store,key=lambda x: x[0])
res=0
for i in range(len(store)):
  if M-store[i][1]<=0:
    res+=store[i][0]*M
    break
  else:
    res+=store[i][0]*store[i][1]
    M=M-store[i][1]
print(res)


### FIXED CODE ###

N, M = map(int, input().split())
shop = []
for i in range(N):
    a, b = map(int, input().split())
    shop.append([a, b])
shop.sort(key=lambda x: x[0])

amount = 0
quantity = 0
for s in shop:
    if quantity + s[1] < M:
        amount += s[0] * s[1]
        quantity += s[1]
    else:
        amount += (M - quantity) * s[0]
        quantity = M
        break

print(amount)
print(int(int(input()))**0.5)**2)

### FIXED CODE ###

print(int(int(input())**0.5)**2)
cnt = 0
def s(start, end):
    global cnt
    if(start==len(S)-1):
        return 
    numS = int(S[start:end+1])
    if(numS%2019==0 and numS!=0):
        cnt += 1
    if(end==len(S)-1):
        end = start+1
        s(start+1, end)
        return
    s(start, end+1)

S = str(input())
s(0, 0)
print cnt

### FIXED CODE ###

S = list(map(int, list(input())))[::-1]
N = len(S)
CNT = [0]*2019
CNT[0] = 1
num = 0
d = 0
for i in range(N):
    num += S[i]*pow(10, d, 2019)
    num %= 2019
    CNT[num] += 1
    d += 1
ans = 0 
for cnt in CNT:
    ans += (cnt*(cnt - 1)) // 2
print(ans)
N,M=map(int,input().split())
AB=[[0,0] for i in range(M)]
for i in range(M):
    AB[i][0],AB[i][1]=map(int,input().split())
par=[i for i in range(N+1)]
rank=[1 for i in range(N+1)]
def Union_Find_find(x):
    global par
    if par[x]==x:
        return x
    else:
        return Union_Find_find(par[x])
def Union_Find_unite(x,y):
    global par
    x=Union_Find_find(x)
    y=Union_Find_find(y)
    if x!=y:
        par[y]=x
        rank[x]=rank[x]+rank[y]
        rank[y]=1

def ncr(n):
    return n*(n-1)//2
res=[]
res.append(ncr(N))
for i in reversed(range(M)):
    if res[-1]!=0:
        if not(Union_Find_same(A,B)):
            A,B=AB[i][0],AB[i][1]
            res.append(res[-1]-rank[par[A]]*rank[par[B]])
            Union_Find_unite(A,B)
    if res[-1]==0:
        res.append(0)
for i in reversed(range(M)):
    print(res[i])


### FIXED CODE ###

N,M=map(int,input().split())
AB=[[0,0] for i in range(M)]
for i in range(M):
    AB[i][0],AB[i][1]=map(int,input().split())
par=[i for i in range(N+1)]
rank=[1 for i in range(N+1)]
hight=[1 for i in range(N+1)]
def Union_Find_find(x):
    global par,rank,hight
    if par[x]==x:
        return x
    else:
        return Union_Find_find(par[x])
def Union_Find_unite(x,y):
    global par,rank,hight
    x=Union_Find_find(x)
    y=Union_Find_find(y)
    if x!=y:
        if hight[x]>hight[y]:
            par[y]=x
            rank[x]=rank[x]+rank[y]
            rank[y]=rank[x]
        else:
            par[x]=y
            rank[x]=rank[x]+rank[y]
            rank[y]=rank[x]
            if hight[x]==hight[y]:
                hight[y]+=1
def Union_Find_same(x,y):
    global par,rank,hight
    return Union_Find_find(x)==Union_Find_find(y)
def ncr(n):
    return n*(n-1)//2
res=[]
res.append(ncr(N))
for i in reversed(range(M)):
    A,B=AB[i][0],AB[i][1]
    if res[-1]!=0:
        if Union_Find_same(A,B):
            res.append(res[-1])
        else:
            res.append(res[-1]-rank[Union_Find_find(A)]*rank[Union_Find_find(B)])
            Union_Find_unite(A,B)
    else:
        res.append(0)
for i in reversed(range(M)):
    print(res[i])
import random


class Dice(object):
    def __init__(self):
        self.t = 1
        self.s = 2
        self.e = 3
        self.w = 4
        self.n = 5
        self.b = 6

    def __init__(self, faces):
        self.t = faces[0]
        self.s = faces[1]
        self.e = faces[2]
        self.w = faces[3]
        self.n = faces[4]
        self.b = faces[5]

    def roll(self, direct):
        if direct == 0:
            self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b
        elif direct == 1:
            self.t, self.w, self.b, self.e = self.e, self.t, self.w, self.b
        elif direct == 2:
            self.n, self.w, self.s, self.e = self.w, self.s, self.e, self.n

    def is_equal(self, dice):
        if self.t == dice.t and self.s == dice.s and self.e == dice.e and self.w == dice.w and self.n == dice.n and self.b == dice.b:
            return True
        else:
            return False

n = int(input())
dice_list = []
flag = True
for _ in range(n):
    faces = list(map(int, input().split()))
    dice_list.append(Dice(faces1))

    if n == 0:
        continue

    dice_a, dice_b = dice_list[0], dice_list[-1]

    for i in range(10000):
        dice_b.roll(random.randint(0, 3))
        if dice_a.is_equal(dice_b):
            break
        if i + 1 == 10000:
            flag = False

    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

import random


class Dice(object):
    def __init__(self):
        self.t = 1
        self.s = 2
        self.e = 3
        self.w = 4
        self.n = 5
        self.b = 6

    def __init__(self, faces):
        self.t = faces[0]
        self.s = faces[1]
        self.e = faces[2]
        self.w = faces[3]
        self.n = faces[4]
        self.b = faces[5]

    def roll(self, direct):
        if direct == 0:
            self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b
        elif direct == 1:
            self.t, self.w, self.b, self.e = self.e, self.t, self.w, self.b
        elif direct == 2:
            self.n, self.w, self.s, self.e = self.w, self.s, self.e, self.n

    def is_equal(self, dice):
        if self.t == dice.t and self.s == dice.s and self.e == dice.e and self.w == dice.w and self.n == dice.n and self.b == dice.b:
            return True
        else:
            return False

    def get_nums(self):
        return {self.t, self.s, self.e, self.w, self.n, self.b}

n = int(input())
dice_list = []
flag_list = []
for _ in range(n):
    flag = False
    faces = list(map(int, input().split()))
    dice_list.append(Dice(faces))

    if n == 0:
        continue

    dice_a = dice_list[-1]
    for i in range(len(dice_list) - 1):
        dice_b = dice_list[i]

        if (dice_a.get_nums() == dice_b.get_nums()):
            for i in range(1000):
                dice_b.roll(random.randint(0, 3))
                if dice_a.is_equal(dice_b):
                    flag = True
                    break

        flag_list.append(flag)

if any(flag_list):
    print('No')
else:
    print('Yes')
import math
import itertools

N = int(input())
x = [0] * N
y = [0] * N

for n in range(N):
    x[n], y[n] = map(int, input().split())


# print(x)
# print(y)

def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

l = x +y
# l = [x1, x2, x3, x4, x5, x6, x7, x8]
m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))


### FIXED CODE ###

import math
import itertools

N = int(input())
x = [list(map(int, input().split())) for i in range(N)]


# print(x)
# print(y)

def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

l = x
# print(l)
# l = [x1, x2, x3, x4, x5, x6, x7, x8]

m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))
N = int(input())

if N == 1:
    print("Hello World")
else:
    A, B = map(int, input().split())
    print(A + B)


### FIXED CODE ###

N = int(input())

if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A + B)
N = int(input())
H = list(map(int,input().split()))	
bool 
for i in range (1, N+1):
  if H[i-1] == H[i] or H[i] == H[i-1] + 1:
    True
  elif H[i+1] == H[i] - 1:
    H[i] -= 1
    if H[i-1] > H[i]:
      False
if (True):
  print('Yes' )
else:
  print('No')
  
    
    
  


### FIXED CODE ###

n = int(input())
lis = list(map(int,input().split()))
lis[0]-=1

for i in range(n-1):
  if lis[i] < lis[i+1]:
    lis[i+1] -= 1
  elif lis[i] > lis[i+1]:
    print("No")
    exit()
print("Yes")