Harryxun/stf_run huggingface dataset:
n = int(input())
h = list(map(int, input().split()))
for i in range(N-1, 0, -1):
    if h[i-1] - h[i] ==1:
        h[i-1]-= 1
    elif h[i-1] -h[i ]> 1:
        flag = False
        print("No")
        break
else:
    print("Yes")

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
 
for i in range(N-1, 0, -1):
    if H[i-1] - H[i] == 1:
        H[i-1] -= 1
    elif H[i-1] - H[i] > 1:
        flag = False
        print('No')
        break
else:
    print('Yes')
n = int(input())
a = list(map(int, input().split()))

a = list(enumerate(a))
a.sort(key = lambda x: x[1], reverse=True)

for i in range(n):
    a[i][0] = a[i][0] + 1

DP = [[0 for i in range(n+1)] for j in range(n+1)]
DP[0][0] = 0
for i in range(1, n+1):
    DP[0][i] = DP[0][i-1] + abs(a[i-1][1] * (n - i + 1 - a[i-1][0]))
    DP[i][0] = DP[i-1][0] + abs(a[i-1][1] * (a[i-1][0] - i))
    for x in range(1, i):
        y = i - x
        DP[x][y] = max(DP[x-1][y] + abs(a[i-1][1] * (a[i-1][0] - x)),  \
            DP[x][y-1] + abs(a[i-1][1] * (n - y + 1 - a[i-1][0])))

ans = 0
for i in range(n+1):
    ans = max(ans, DP[i][n-i])

print(ans) 

### FIXED CODE ###

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

a = list(enumerate(a))
a.sort(key = lambda x: x[1])

DP = [[0 for i in range(n+1)] for j in range(n+1)]
DP[0][0] = 0
for i in range(1, n+1):
    pos, val = a.pop()
    pos = pos + 1

    DP[0][i] = DP[0][i-1] + abs(val * (n - i + 1 - pos))
    DP[i][0] = DP[i-1][0] + abs(val * (pos - i))
    for x in range(1, i):
        y = i - x
        DP[x][y] = max(DP[x-1][y] + abs(val * (pos - x)),  \
            DP[x][y-1] + abs(val * (n - y + 1 - pos)))

ans = 0
for i in range(n+1):
    ans = max(ans, DP[i][n-i])

print(ans)
import math
lst = []
for i in range(5):
  lst.append(int(input()))
minu = 9
for j in range(5):
  if int(str(lst[j])[-1]) < minu and int(str(lst[j])[-1]) > 0:
    minu = int(str(lst[j])[-1])
    temp = lst[j]
lst.remove(temp)
time = 0
for k in range(4):
  time += int(math.ceil(lst[k]/10) * 10)
time += temp
print(time)

### FIXED CODE ###

import math
lst = []
for i in range(5):
  lst.append(int(input()))
minu = 9
temp = 0
count = 0
for j in range(5):
  if int(str(lst[j])[-1]) < minu and int(str(lst[j])[-1]) > 0:
    minu = int(str(lst[j])[-1])
    temp = lst[j]
    count += 1
if count > 0:
  lst.remove(temp)
else:
  temp = lst[0]
  del lst[0]
time = 0
for k in range(4):
  kari = math.ceil(int(lst[k])/10)
  time += int(kari * 10)
time += temp
print(time)
from collections import deque
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
a = deque(A)
b = deque(B)
ans = 0
l = len(a) + len(b)
while a and b:
    if K - a[0] >= 0 or K - b[0] >= 0:
        if a[0] > b[0]:
            x = b.popleft()
            K = K - x
            ans += 1
        if a[0] <= b[0]:
            x = a.popleft()
            K = K - x
            ans += 1
    else:
        break
C = list(a) + list(b)
c = deque(C)
while c:
    if K - c[0] >= 0:
        x = c.popleft()
        K = K - x
        ans += 1
    else:
        break
print(ans)

### FIXED CODE ###

from bisect import bisect
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
a = [0] * (N+1)
b = [0] * (M+1)
for i in range(N):
    a[i+1] = a[i] + A[i]
for i in range(M):
    b[i+1] = b[i] + B[i]
ans = 0
for i in range(N+1):
    tmp = K - a[i]
    if tmp < 0:
        break
    ans = max(ans, i + bisect(b, tmp) - 1)
print(ans)
from sys import exit

N = int(input())

q = {}

for i in range(N):
    q[i + 1] = []

for i in range(N - 1):
    _u, _v, _w = map(int, input().split())

    q[_u].append((_v, _w))
    q[_v].append((_u, _w))

reached = []
distances = {}


def search(x, distance):
    if x in reached:
        # 既に達しているところだったら
        return

    # 達したことを記録
    reached.append(x)
    distances[x] = distance

    for s in q[x]:
        search(s[0], distance + s[1])


search(1, 0)
print(distances)

for i in range(N):
    if i == 0:
        print(0)
        continue
    if distances[i + 1] % 2 == 0:
        print(0)
    else:
        print(1)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

N = int(input())

q = {}

for i in range(N):
    q[i] = []

for _ in range(N - 1):
    _u, _v, _w = map(int, input().split())

    q[_u - 1].append((_v - 1, _w))
    q[_v - 1].append((_u - 1, _w))

ans = [None] * N
ans[0] = 0


def search(x, parent_num):
    for s in q[x]:
        if ans[s[0]] is None:
            ans[s[0]] = (parent_num + s[1]) % 2
            search(s[0], ans[s[0]])


search(0, 0)

for i in range(N):
    print(ans[i])
# -*- coding:utf-8 -*-
a, b, c, d = map(int, input().split)
l = a+b
r = c+d
if l > r:
    print("Left")
elif l < r:
    print("Right")
else:
    print("Balanced")

### FIXED CODE ###

# -*- coding:utf-8 -*-
a, b, c, d = map(int, input().split())
l = a+b
r = c+d
if l > r:
    print("Left")
elif l < r:
    print("Right")
else:
    print("Balanced")
N=int(input())
S=input()
s=0
s+=S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for j in range(i+1,j):
    k=2*j-1
    if k<n and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      s-=1
print(s)      

### FIXED CODE ###

N=int(input())
S=input()
s=0
s+=S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for j in range(i+1,N):
    k=2*j-i
    if k<N and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      s-=1
print(s)
l=list(map(int,input().split()))
c = collections.Counter(l)
print(c)

### FIXED CODE ###

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

l=[a,b,c]

print(len(set(l)))
import math

try:
 while 1:
  a,b=map(int,input().split())
  print(math.gcd(a,b),a*b// math.gcd(a, b))
except EOFError:
   pass
 

### FIXED CODE ###

def gcd(x,y):
    while y:
        x, y = y, x % y
    return x


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


while True:
    try:
        a = list(map(int,input().split()))
        print(gcd(a[0],a[1]),lcm(a[0],a[1]))
    except:
        break
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def error_mat_print(m):
    for r in m:
        print(r, file=sys.stderr)

def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(L, A):

    dp = [[sys.maxsize] * (L+1) for _ in range(5)]
    dp[0][0] = 0

    for i, a in enumerate(A):
        t = dp[0][i]
        dp[0][i+1] = t + a
        t = min(t, dp[1][i])
        dp[1][i+1] = t+ ((a%2) if a != 0 else 2)
        t = min(t, dp[2][i])
        dp[2][i+1] = t + ((a+1)%2)
        t = min(t, dp[3][i])
        dp[3][i+1] =t + ((a%2) if a != 0 else 2)
        t = min(t, dp[4][i])
        dp[4][i+1] = t + a


    return min([dp[i][L] for i in range(5)])

def main():
    L = read_int()
    A = [read_int() for _ in range(L)]
    print(slv(L, A))


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K):
    return 'YES' if int(math.ceil(N/2)) >= K else 'NO'


def main():
    # N = read_int()
    N, K = read_int_n()
    # A = [read_int_n() for _ in range(N)]
    print(slv(N, K))


if __name__ == '__main__':
    main()
import sys
from collections import defaultdict

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

def recordnum(a,b):
    if not (0 < a < H-1 and 0 < b < W-1):
        return 
    else:
        res = M[(a,b)]
        for i,j in vector:
            res += M[(a+i,b+j)]
        num[res] += 1
        return


def dfs(a,b,color):

    if visited[(a,b)]:
        return
    
    recordnum(a,b)
    visited[(a,b)] = True

    if color == "b":
        for i,j in vector:
            x = a+i
            y = b+j
            if 0 < x < H-1 and 0 < y < W-1:
                if M[(x,y)]:
                    dfs(x,y,"b")
                else:
                    dfs(x,y,"w")
    else:
        ##白い箇所から白い箇所への探索はしない
        for i,j in vector:
            x = a+i
            y = b+j
            if 0 < x < H-1 and 0 < y < W-1 and M[(x,y)]:
                dfs(a,b,"b")

    


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

M = defaultdict(int)
visited = defaultdict(int)
ab = []

for _ in range(N):
    a,b = map(int,input().split())
    ab.append([a-1,b-1])
    M[(a-1,b-1)] = 1


vector = [[0,1],[0,-1],[1,0],[-1,0],[1,1],[-1,-1],[1,-1],[-1,1]]
num = [0]*10

for a,b in ab:
    dfs(a,b,"b")

num[0] = (H-2)*(W-2) - sum(num)

for i in num:
    print(i)

### FIXED CODE ###

"""
参考(神様)
https://atcoder.jp/contests/abc045/submissions/6046010
"""

###かぶるやつを考える.例えばあるマスのかぶり値が9だとしたら,
###周囲はすべて黒->j=9のが1つとカウントしてよい,他の値についても同様.

import sys
from collections import defaultdict,Counter

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

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

covered = defaultdict(int)
vector = [(0,0),(0,1),(0,-1),(1,0),(-1,0),(1,1),(-1,-1),(1,-1),(-1,1)]

for _ in range(N):
    a,b = map(int,input().split())

    for i,j in vector:
        x = a+i-1
        y = b+j-1

        if 0 < x < H-1 and 0 < y < W-1:
            covered[(x,y)] += 1

num = Counter(covered.values())
##print(num)
num[0] = (H-2)*(W-2)-sum(num.values())

for i in range(10):
    print(num[i])
while True:
a,b=[int(x) for x in input().split()]
if a==0 and b==0: break
elif a<b:
print(a,b)
else:
print(b,a)



### FIXED CODE ###

while True:
    a, b = sorted(map(int, input().split()))
    if a == 0 and b == 0:
        break
    print(a, b)
S = str(input())
k = int(input())
if len(S) == 1:
    print(S)
    exit()
for i in range(10):
    if S[i] == "1" and int(S[i]) == k:
        print("1")
    elif S[i] != "1":
        print(S[i])
        break


### FIXED CODE ###

S = str(input())
k = int(input())
for i in range(k):
    if S[i] != "1":
        print(S[i])
        exit()
print("1")
s1=list(input())
s2=list(input())
a=[s1,s2]
for x in range3:
    if a[0][x]!=a[1][2-x]:
        print("NO")
        exit()
print("YES")


### FIXED CODE ###

s1=list(input())
s2=list(input())
a=[s1,s2]
for x in range(3):
    if a[0][x]!=a[1][2-x]:
        print("NO")
        exit()
print("YES")
def is_prime(x):
    n = math.floor(math.sqrt(x))
    for i in range(2,n+1):
        if x % i == 0:
            return False
    return True            
a = int(input())
while not(is_prime(a)):
    a += 1    
print(a)

### FIXED CODE ###

import math
def is_prime(x):
    n = math.floor(math.sqrt(x))
    for i in range(2,n+1):
        if x % i == 0:
            return False
    return True            
a = int(input())
while not(is_prime(a)):
    a += 1    
print(a)
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))


N = readint()
S = readstr()
Q = readint()
K = readints()

ans = []
for k in K:
    m = 0
    c = 0
    a = [0]
    if 'D' not in S:
        ans.append(0)
        break
    d = S.find('D')
    for i in range(d+1,d+k):
        if S[i]=='M':
            m += 1
        if S[i]=='C':
            c += 1
            a[-1] += m
    a.append(a[-1])
    for i in range(d+1,N):
        if i+k-1<N:
            if S[i+k-1]=='M':
                m += 1
            elif S[i+k-1]=='C':
                c += 1
                a[-1] += m
        if S[i-1]=='M':
            m -= 1
            a[-1] -= c
        elif S[i-1]=='C':
            c -= 1
        if S[i]=='D':
            a.append(a[-1])
    ans.append(sum(a[:-1]))
printrows(ans)




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))


N = readint()
S = readstr()
Q = readint()
K = readints()

if 'D' not in S:
    printrows([0]*Q)
    exit()
d = S.find('D')
e = S.rfind('D')
ans = []
for k in K:
    m = 0
    c = 0
    a = 0
    for i in range(d+1,min(N,d+k)):
        if S[i]=='M':
            m += 1
        if S[i]=='C':
            c += 1
            a += m
    b = a
    for i in range(d+1,N):
        if i+k-1<N:
            if S[i+k-1]=='M':
                m += 1
            elif S[i+k-1]=='C':
                c += 1
                a += m
        if S[i-1]=='M':
            m -= 1
            a -= c
        elif S[i-1]=='C':
            c -= 1
        if S[i]=='D':
            b += a
            if i==e:
                break
    ans.append(b)
printrows(ans)
a,b,m=map(int, input().split())
list_a=[ int(i)  for i in input().split()]
list_b=[ int(i)  for i in input().split()]
x,y,c=([],[],[])
for i in range(m):
    s=list(map(int, input().split()))
    x+=[s[0]]
    y+=[s[1]]
    c+=[s[2]]
print(min([ list_a[x[i]-1] + list_b[y[i]-1] - c[i]   for i in range(len(c))]+[min(list_a)+min(list_b)]))

### FIXED CODE ###

S=input()
if(len(S)%2==0):
  for i in range(len(S)//2):
    if(S[2*i]!="h" or S[2*i+1]!="i"):
      print("No")
      break
  else:
    print("Yes")
else:
  print("No")
N,A,B = map(int, input().split())

ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem,A)
print(ans)

### FIXED CODE ###

s = input()
if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')
INF = 10 ** 9 + 7

S = input()
# dp[i][j]はうしろからi桁を13で割った余りがjであるものの個数
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i + 1][(mul * k + j) % 13] += dp[i][j]
                # dp[i + 1][(mul * k + j) % 13] %= INF
    else:
        k = int(x)
        for j in range(13):
            dp[i + 1][(mul * k + j) % 13] += dp[i][j]
            # dp[i + 1][(mul * k + j) % 13] %= INF
    mul *= 10

print(dp[len(S)][5] %= INF)


### FIXED CODE ###

INF = 10 ** 9 + 7

S = input()
# dp[i][j]はうしろからi桁を13で割った余りがjであるものの個数
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i + 1][(mul * k + j) % 13] += dp[i][j]
                dp[i + 1][(mul * k + j) % 13] %= INF
    else:
        k = int(x)
        for j in range(13):
            dp[i + 1][(mul * k + j) % 13] += dp[i][j]
            dp[i + 1][(mul * k + j) % 13] %= INF
    mul = mul * 10 % 13

print(dp[len(S)][5])
n=int(input())
ls=[]
temp=[]
temp= list((for x in input().split()))
temp=list(set([x for x in l if l.count(x)>1]))
for x in l:
	if (l.count(x)>3):
		ls.append(x)
temp+=list(set(ls))
if len(temp)<2:
	print(0)
else:
	x=max(temp)
	temp.remove(x)
	print(x*max(temp))

### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
a.sort()
lar=sec=i=0
while(i<n-1):
    if a[i]==a[i+1]:
        i+=1
        if a[i]>lar:
            sec=lar
            lar=a[i]
        elif a[i]>sec:
             sec=a[i]
    i+=1
print(lar*sec)
n=int(input())
data=input().split()

count=0
for i in range(1,n-1):
  if int(data[i])>int(data[i-1]) and int(data[i])<=int(data[i+1]):
    count=+1
  elif int(data[i])<int(data[i-1]) and int(data[i])>=int(data[i+1]):
    count+=1

print(count)


### FIXED CODE ###

data=input()
if data[0]==data[1] and data[2]==data[3] and data[0]!=data[2]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3] and data[0]!=data[1]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2] and data[0]!=data[1]:
  print("Yes")
else:
  print("No")
N = int(input())
if N >= 1000:
  print("ABD")
else:
  print("ABC)

### FIXED CODE ###

N = int(input())
if N >= 1000:
  print("ABD")
else:
  print("ABC")
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

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

A = []
B = []

for _ in range(M):
    a,b = map(int, input().split())
    if a == 1: A.append(b)
    elif b == N: B.append(a)

B.sort()
for a in A:
    if B[bisect.bisect_left(B, a)]==a:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

### FIXED CODE ###

#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

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

A = []
B = []

for _ in range(M):
    a,b = map(int, input().split())
    if a == 1: A.append(b)
    elif b == N: B.append(a)

B.sort()
for a in A:
    if bisect.bisect_left(B, a) < len(B) and B[bisect.bisect_left(B, a)]==a:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")
N = int(input())
A = sorted([int(i) for i in input().split()])

ls = []
for i in range(N):
    if A.count(A[i]) == 1:
        ls.append(A[i])

if len(ls) == 0:
    print(0)
else:
    limit = int(ls[-1] ** 0.5)
    ans = 0
    while limit > ls[0]:
        if len(ls) == 1:
            ans += 1
        elif ls[0] != ls[1]:
            ans += 1
        ls = [i for i in ls if i % ls[0] != 0]
    
    print(ans+len(ls))

### FIXED CODE ###

from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)
#ABC138D
#node:節 edge:枝
def main():
    import sys
    N, Q = map(int, sys.stdin.readline().split())
    edge = [tuple(map(int, sys.stdin.readline().split())) for _ in range(N-1)]
    #1:ノードのリストを作る
    nodeL = [[] for _ in range(N)]
    for a, b in edge:
        nodeL[a-1].append(b-1)
        nodeL[b-1].append(a-1)
    #print(nodeL)
    px = [tuple(map(int, sys.stdin.readline().split())) for _ in range(Q)]
    #print(px)
    score = [0 for i in range(N)]
    for p, x in px:
        score[p-1] +=x
    #print(score)
    result = score.copy()
    
    def dfs(p, g=-1):
        for c in nodeL[p]:
            if c !=g:
                score[c] +=score[p]
                dfs(c, p)
    
    
    dfs(0)
    print(score)
    


if __name__=='__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(1000000)

n,q = map(int, input().split())
a_b = [list(map(int, sys.stdin.readline().split())) for _ in range(n-1)]
p_x = [list(map(int, sys.stdin.readline().split())) for _ in range(q)]

v = [deque([]) for i in range(n)]
for e in a_b:
    v[e[0]-1]+=[e[1]-1]
    v[e[1]-1]+=[e[0]-1]
score = [0 for i in range(n)]
for e in p_x:
    score[e[0]-1]+=e[1]
def dfs(p, bp=-1):
    while v[p]:
        c =v[p].popleft()
        if c ==bp:
            continue
        #print(p, c, bp)
        score[c]+=score[p]
        dfs(c, bp=p)
visited = [0]                
dfs(0)
print(*score)
import sympy
x = sympy.Symbol('x')
y = sympy.Symbol('y')

s = input()
lst = s.split()

ex1 = x + y - int(lst[0])
ex2 = 2 * x + 4 * y - int(lst[1])

d = sympy.solve([ex1, ex2])

if d[x] >= 0 and d[y] >= 0:
    print("yes")
else:
    print("no")



### FIXED CODE ###

s = input()
lst = s.split()

ex1 = int(lst[0])
ex2 = int(lst[1])
ret = "No"

for i in range(ex1+1):
    if 4 * (ex1 - i) + 2 * i == ex2:
        ret= "Yes"

print(ret)
#!/usr/bin/env python3
import sys
import collections

def solve(N: int, A: "List[int]"):
    counter = sorted(list(collections.Counter(A).values()),reverse=True)
    for i in range(1,N+1):
        c_index = 0
        n = N
        while counter[c_index]*i > N:
            n-=counter[c_index]
            c_index+=1
            i-=1
        print(n//i)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import collections

def solve(N: int, A: "List[int]"):
    counter = sorted(list(collections.Counter(A).values()),reverse=True)
    c_index = 0
    k=0
    for i in range(1,N+1):
        k+=1
        if len(counter)<i:
            print(0)
            continue
        while counter[c_index]*k > N and c_index<len(counter)-1:
            N-=counter[c_index]
            c_index+=1
            k-=1
        print(N//k)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
N, A, B = map(int, input().split())
L = A + B
S = ('b' * A) + ('r' * B)
count = 0
for i in range(0, N):
	s = S[i%L]
	if s == 'b':
		count += 1
print(count)


### FIXED CODE ###

N, A, B = map(int, input().split())

x, y = divmod(N, A+B)
print(x * A + min(A, y))
a,b = map(int,input().split())

temp=["#" for _ in b+2]
mass = []
mass.append(temp)
for _ in range(a):
  mass.append(["#"] + list(input()) + ["#"])
mass.append(temp)

for retsu in mass:
  retsu = "".join(retsu)
  print(retsu)

### FIXED CODE ###

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

temp=["#" for _ in range(b+2)]
mass = []
mass.append(temp)
for _ in range(a):
  mass.append(["#"] + list(input()) + ["#"])
mass.append(temp)

for retsu in mass:
  retsu = "".join(retsu)
  print(retsu)
n=input()
s, t=str(input()).split()
for i in range(n):
  print(list(s)[i], list(t)[i], sep='', end='')


### FIXED CODE ###

n=input()
s, t=str(input()).split()
for i in range(int(n)):
  print(list(s)[i], list(t)[i], sep='', end='')
N = int(input())
A = map(int, input().split())

A_set = set(A)
if len(A_set) == 1:
    print(A_set[0])
else:
    A = list(A_set)
    A = sorted(A)
    if (A[0] % 2 == 0) and (A[1] % 2 ==0):
        print("2")
    else:
        print("1")

### FIXED CODE ###

import fractions

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

minA = A[0]

for i in A:
    minA = fractions.gcd(minA, i) 

print(minA)