Harryxun/stf_run huggingface dataset:
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9,10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40,45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A, B = map(int, input().split())
print(A*B if A <= 9 and B <= 9 else -1)
n,x =map(int,input().split())
a=[map(int,input().split())]
ans=0
for i in range(n-1):
  if(a[i]+a[i+1]>x):
    p = a[i]+a[i+1]-x
    ans+=p
    a[i+1]=max(0,a[i+1]-p)
print(ans)

### FIXED CODE ###

n,x =map(int,input().split())
a=[int(x) for x in input().split()]
ans=0
for i in range(n-1):
  if(a[i]+a[i+1]>x):
    p = a[i]+a[i+1]-x
    ans+=p
    a[i+1]=max(0,a[i+1]-p)
print(ans)
N,M=map(int,input().split())
P=list(map(int,input().split()))
par=[i for i in range(N)]
ans=0

def root(x):
    if x!=par[x]:
        par[x]=root(par[x])
    return par[x]

def connect(x,y):
    if root(x)!=root(y):
        par[root(y)]=root(x)

for i in range(M):
    x,y=map(int,input().split())
    connect(x-1,y-1)

for i in range(N):
    if root(i)==root(P[i]-1):
        ans+=1

print(ans)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print('Yes' if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d) else 'No')
a, b = map(int, input().split())
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')
import math

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

a,b=map(int,input().strip().split())
print(lcm(a, b))

### FIXED CODE ###

import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
a,b=map(int,input().strip().split())
print(lcm(a, b))
li = list(input())
for i in len(li):
  if(not i == 0 and li[i] == "B"): 
    li[i-1] = ""
    li[i] = ""
print("".join(li))

### FIXED CODE ###

li = list(input())
ans = ""
for i in li:
  if i == "0":
    ans = ans + "0"
  elif i == "1":
    ans = ans + "1"
  elif i == "B":
    ans = ans[:len(ans)-1]
print(ans)
a,b,k = map(int,input().split())

x =list(range(a,b+1))
ans =[]

for i in range(k):
  if len(x) >= i:
    if not(x[i] in ans):
      ans.append(x[i])
    if not(x[-(1+i)] in ans):
      ans.append(x[-(1+i)])
  
ans.sort()

s = "\n".join(map(str,ans))
print(s)



### FIXED CODE ###

A,B,K = map(int,input().split())
            
ans=[]
            
for i in range(K):
  if A+i <=B:
    ans.append(A+i)
  if B-i >= A:
    ans.append(B-i)
            
            
ans = sorted(list(set(ans)))
print(*ans,sep="\n")
import numpy as np
N,D=map(int,input().split())
A=0
for i in range(N):
  X,Y=map(int,input().split())
  if np.linalg.norm(X-Y) <=D:
    A+=1
print(A)

### FIXED CODE ###

N,D=map(int,input().split())
X=0
for i in range(N):
  a,b = map(int,input().split())
  if ((a)**2+(b)**2)**0.5<=D:
    X+=1
print(X)
a, p = map(int, input().split())
num = a*3 // p
print(num)

### FIXED CODE ###


a, p = map(int, input().split())
num = (a*3 + p) // 2
print(num)
import sys
import numpy as np

from numba import njit, int64


@njit(int64(int64, int64[:]), cache=True)
def solve(n, ppp):
    n2 = n + 2
    nsq = n2 * n2
    seats = np.zeros(nsq, dtype=np.int64)
    is_seated = np.zeros(nsq, dtype=np.int8)
    for i in range(n):
        ud = min(i, n - 1 - i)
        ri = (i + 1) * n2
        for j in range(n):
            ij = ri + j + 1
            seats[ij] = min(ud, j, n - 1 - j)
            is_seated[ij] = 1

    MOVES = np.array([-n2, -1, 1, n2], dtype=np.int64)

    ans = 0

    for p in ppp:
        i, j = divmod(p - 1, n)
        i = (i + 1) * n2 + j + 1
        res = seats[i]
        ans += res
        is_seated[i] = 0

        deque = [(0, 0)] * 500000
        deque[0] = (res, i)
        l, r = 0, 1

        while l < r:
            val, j = deque[l]
            # print(val, j, deque[l:r] if l >= 0 else deque[l:] + deque[:r])
            l += 1
            seats[j] = val

            if is_seated[j]:
                val += 1
                for dj in MOVES:
                    nj = j + dj
                    if seats[nj] > val:
                        deque[r] = (val, nj)
                        r += 1
            else:
                for dj in MOVES:
                    nj = j + dj
                    if seats[nj] > val:
                        l -= 1
                        deque[l] = (val, nj)

    return ans


n = int(sys.stdin.buffer.readline())
ppp = np.array(list(map(int, sys.stdin.buffer.read().split())), dtype=np.int64)
print(solve(n, ppp))

# solve.inspect_types()
# bfs.inspect_types()


### FIXED CODE ###

import sys
import numpy as np

from numba import njit


@njit('i4(i4,i4[:])', cache=True)
def solve(n, ppp):
    n2 = n + 2
    nsq = n2 * n2
    seats = np.zeros(nsq, dtype=np.int16)
    is_seated = np.zeros(nsq, dtype=np.int8)
    for i in range(n):
        ud = min(i, n - 1 - i)
        ri = (i + 1) * n2
        for j in range(n):
            ij = ri + j + 1
            seats[ij] = min(ud, j, n - 1 - j)
            is_seated[ij] = 1

    MOVES = np.array([-n2, -1, 1, n2], dtype=np.int32)

    ans = 0

    for pi in range(n * n):
        i, j = divmod(ppp[pi], n)
        i = (i + 1) * n2 + j + 1
        res = seats[i]
        ans += res
        is_seated[i] = 0

        q = []
        for mi in range(4):
            ni = i + MOVES[mi]
            if seats[ni] > res:
                seats[ni] = res
                q.append(ni)

        while q:
            j = q.pop()
            # print(val, j, seats[j], l, r)
            val = seats[j]

            if is_seated[j]:
                val += 1
            for mi in range(4):
                nj = j + MOVES[mi]
                if seats[nj] > val:
                    seats[nj] = val
                    q.append(nj)

        # print(ppp[pi] + 1, i, ans)
        # print(seats.reshape((n2, n2)))
        # print(is_seated.reshape((n2, n2)))

    return ans


n = int(sys.stdin.buffer.readline())
ppp = np.array(list(map(int, sys.stdin.buffer.read().split())), dtype=np.int32) - 1

# n = 20
# np.random.seed(seed=32)
# ppp = np.random.permutation(n * n).astype(np.int32)
# print(ppp)

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

inf = float('inf')

# 累積和
if n % 2 == 0:
  	while True:
      pass
    l_even = [0]
    l_odd = [0]
    for i in range(n):
        if i % 2 == 0:
            l_even.append(l_even[-1] + a[i])
        else:
            l_odd.append(l_odd[-1] + a[i])
    ans = -inf
    for i in range(n // 2 + 1):
        if ans < l_even[i] + l_odd[-1] - l_odd[i]:
            ans = l_even[i] + l_odd[-1] - l_odd[i]
    print(ans)
    exit()

# dp[i] = i回ずらしを使った時の最大値
# 1個ずつdpを更新
# i = 0, 1, 2
dp = [a[0], a[1], a[2]]
for i in range(2, n, 2):
    try:
        dp[2] = max([dp[2] + a[i+2], dp[1] + a[i+2]])
    except:
        pass
    try:
        dp[1] = max([dp[1] + a[i+1], dp[0] + a[i+1]])
    except:
        pass
    dp[0] += a[i]

print(max(dp))

### FIXED CODE ###

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

inf = float('inf')

# 累積和
if n % 2 == 0:
    l_even = [0]
    l_odd = [0]
    for i in range(n):
        if i % 2 == 0:
            l_even.append(l_even[-1] + a[i])
        else:
            l_odd.append(l_odd[-1] + a[i])
    ans = -inf
    for i in range(n // 2 + 1):
        if ans < l_even[i] + l_odd[-1] - l_odd[i]:
            ans = l_even[i] + l_odd[-1] - l_odd[i]
    print(ans)
    exit()

# dp[i] = i回ずらしを使った時の最大値
# 1個ずつdpを更新
# i = 0, 1, 2
dp = [a[0], a[1], a[2]]
for i in range(2, n-2, 2):
    dp[2] = max([dp[2] + a[i+2], dp[1] + a[i+2]])
    dp[1] = max([dp[1] + a[i+1], dp[0] + a[i+1]])
    dp[0] += a[i]

print(max(dp))
N=int(input())
s=0
S=str(N):
for i in S:
    s+=int(i)
if N%s==0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N=int(input())
s=0
S=str(N)
for i in S:
    s+=int(i)
if N%s==0:
    print("Yes")
else:
    print("No")
ab = 0
ab = input()
num_ab = ab.split()
if int(num_ab[0]) < int(num_ab[1]):
    print('a < b')
elif int(num_ab[0]) > int(num_ab[1]):
    print('a > b')
else:
    print('a == b')

### FIXED CODE ###

ab = input()
num_ab = ab.split()
a = int(num_ab[0])
b = int(num_ab[1])
if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

mi = min(t % 10 for t in [a, b, c, d, e] if t % 10 != 0)
# print(mi)

# print([wt + (10 - (wt % 10)) if wt % 10 != 0 else wt for wt in [a, b, c, d, e]])
print(sum([wt + (10 - (wt % 10)) if wt % 10 != 0 else wt for wt in [a, b, c, d, e]]) - 10 + mi)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


ar = [t % 10 for t in [a, b, c, d, e] if t % 10 != 0]
if len(ar) == 0:
    ar.append(0)
mi = min(ar)


# print(mi)

# print([wt + (10 - (wt % 10)) if wt % 10 != 0 else wt for wt in [a, b, c, d, e]])
w = sum([wt + (10 - (wt % 10)) if wt % 10 != 0 else wt for wt in [a, b, c, d, e]])

if mi > 0:
    w = w - 10 + mi
print(w)
import numpy as np

args = [int(i) for i in input().split()]
N = args[0]
P = args[1]

num = 1
i = 2

count = 0
while True:
    if P % i == 0:
        P /= i
        count += 1
    else:
        x = count // N
        num *= i**x
        break

i = 3
while True:
    count = 0
    while True:
        if P % i == 0:
            P /= i
            count += 1
        else:
            x = count // N
            num *= i**x
            i += 2
            break
    if i**N > P:
        break

print(num)


### FIXED CODE ###

N = input()

count = N.count('2')

print(count)
import numpy as np

def read_input():
    n = int(input())
    alist = list(map(int, input().split()))

    return n, alist


def split_a(alist):
    result = []
    for i in range(len(alist)):
        result.append(alist[:i] + alist[i+1:])

    return result

gcd_memo = {}

def gcd_with_memo(ar):
    if len(ar) == 1:
        return ar[0]

    if len(ar) == 2:
        a = min(ar[0], ar[1])
        b = max(ar[0], ar[1])
        if (a,b) in gcd_memo.keys():
            return gcd_memo[(a,b)]

        g = np.gcd(a, b)
        gcd_memo[(a, b)] = g
        return g

    return gcd_with_memo(gcd_with_memo(ar[:2]), gcd_with_memo(ar[2:]))



if __name__ == '__main__':
    n, a = read_input()
    cand = split_a(a)

    maxgcd = 0
    for c in cand:
        test = gcd_with_memo(c)
        if test > maxgcd:
            maxgcd = test


    print(maxgcd)

### FIXED CODE ###



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

def gcd_all(lst):
    g = gcd(lst[0], lst[1])
    for e in lst[2:]:
        g = gcd(g, e)
    return g


def submit():
    n = int(input())
    alist = list(map(int, input().split()))

    if n == 2:
        print(max(alist))
    else:
        # 左から計算したgcd列
        gcd_left = [alist[0]]
        for a in alist[1:]:
            gcd_left.append(gcd(gcd_left[-1], a))
        
        # 右から計算したgcd列
        gcd_right = [alist[-1]]
        for a in reversed(alist[:-1]):
            gcd_right.append(gcd(gcd_right[-1], a))
        gcd_right = gcd_right[::-1]

        gcd_max = 0
        for i in range(n):
            if i == 0:
                gcd_i = gcd_right[i + 1]
            elif i == n - 1:
                gcd_i = gcd_left[i - 1]
            else:
                gcd_i = gcd(gcd_left[i - 1], gcd_right[i + 1])

            if gcd_max < gcd_i:
                gcd_max = gcd_i

        print(gcd_max)


if __name__ == "__main__":
    submit()
from collections import Counter
from scipy.special import comb
N = int(input())
An = list(map(int, input().split()))
counter = Counter(An)
cnt = 0
for c in counter.values():
    cnt += comb(c, 2)
for a in An:
    if counter[a] < 3:
        print(0)
    else:
        print(int(cnt - comb(counter[a], 2) + comb(counter[a]-1, 2)))


### FIXED CODE ###

from collections import Counter
N = int(input())
An = list(map(int, input().split()))
counter = Counter(An)
cnt = 0
for c in counter.values():
    cnt += c * (c-1) // 2
for a in An:
    print(cnt - (counter[a] - 1))
n = int(raw_input())
for i in range(n):
    a,b,c = map(int, raw_input().split()).sort(reverse = True)
    if a*a == b*b + c*c:
        print "YES"
    else:
        print "NO"


### FIXED CODE ###

n = int(raw_input())
for i in range(n):
    num = map(int, raw_input().split())
    num.sort(reverse=True)
    if num[0]**2 == num[1]**2 + num[2]**2:
        print "YES"
    else:
        print "NO"
N = int(input())
A = list(map(int, input().split()))

if len(set(A)) == N:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

S,T=input().split()
a,b=map(int,input().split())
U=input()
if(S==U):
  a=a-1
else:
  b=b-1
print(a,b)
N, K = map(int, raw_input().split())
if K == 1:
    print(0)
    exit()

print(N-K)


### FIXED CODE ###

N, K = map(int, input().split())
if K == 1:
    print(0)
    exit()

print(N-K)
n,d=map(int,input().split())
x=[]
for i in range(n):
    a=list(map(int,input().split()))
    x.append(a)
import math
c=0
d=0
e=0
for j in range (n-1):
    for k in range(j+1,n):
        for m in range(d):
            d+=float((x[j][m]-x[k][m])*(x[j][m]-x[k][m]))
        c=float(math.sqrt(d))
        if(c.is_integer()=1):
            e+=1
        d=0
print('{0}'.format(e))
        
        

### FIXED CODE ###

n,a,b=map(int,input().split())
print('{0}'.format(min(b,n*a)))
from collections import deque
n = int(input())
q = deque(maxlen=n-1)

for i in range(n - 1):
    a, b, c = map(int, input().split())
    q.append([a-1, b-1, c % 2])

cllist = [-1] * n
a, b, c = q.popleft()
cllist[a] = 0
cllist[b] = c
while q:
    a, b, c = q.popleft()
    if cllist[a] != -1:
        cllist[b] = (cllist[a] + c) % 2
    elif cllist[b] != -1:
        cllist[a] = (cllist[b] + c) % 2
    else:
        q.append([a, b, c])
print(*cllist)


### FIXED CODE ###

n, m = map(int, input().split())

p = list(range(n))


def find(x):
    if p[x] != x:
        p[x] = find(p[x])
    return p[x]


def union(x, y):
    x, y = find(x), find(y)
    p[x] = p[y] = min(x, y)


for _ in range(m):
    x, y, z = [int(i) - 1 for i in input().split()]
    if find(x) != find(y):
        union(x, y)

ans = set()
for i in range(n):
    find(i)
print(len(set(p)))
import sys
input = sys.stdin.readline

N = list(map(int, input().split())).sorted()
if N[0] == 1 and N[1] == 4 and N[2] == 7 and N[3] == 9:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

import sys
input = sys.stdin.readline

N = sorted(list(map(int, input().split())))
if N[0] == 1 and N[1] == 4 and N[2] == 7 and N[3] == 9:
    print("YES")
else:
    print("NO")
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m == M:
    ans.append(n)
print(max(ans))

### FIXED CODE ###

import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m >= M:
    ans.append(n)
print(max(ans))
u,v = raw_input().split(' ')
print 'Yes' if u == v[:-1] else 'No'

### FIXED CODE ###

u = raw_input()
v = raw_input()
print 'Yes' if u == v[:-1] else 'No'
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]


    for i in range(n-1):
        if(max < row[n-1]):
            max = row[n-1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (min)
    




### FIXED CODE ###

n = int(input())

if (n%2 == 0):
    print(n)
else:
    print(2*n)
a=int(input())
b=int(input())
c=int(input())

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

### FIXED CODE ###

a,b,c = list(map(int,input().split()))
if a==b+c or b==a+c or c==a+b :print('Yes')
else:print('No')
a=input()
b=input()
print(b+a)

### FIXED CODE ###

a,b=input().split()

print(b+a)
N = int(input())
Hs = list(map(int, input().split()))
max_cnt = 0
tmp = 1 if Hs[0] >= Hs[1] else 0
for i in range(1,N):
    if Hs[i-1] < Hs[i]:
        max_cnt = max(max_cnt, tmp)
        tmp = 0
    else:
        tmp += 1
print(max(max_cnt, tmp))

### FIXED CODE ###

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

max_cnt = 0
cnt = 0
for i in range(N-1):
    if Hs[i] < Hs[i+1]:
        max_cnt = max(max_cnt, cnt)
        cnt = 0
    else:
        cnt += 1
print(max(max_cnt, cnt))
n = int(input())
list = input().split()

for i in range(n):
    list[i] = int(list[i]) - (i + 1)

b = int(median(list))

for i in range(n):
    list[i] = abs(list[i] - b)

print(sum(list))



### FIXED CODE ###

from statistics import *



n = int(input())
list = input().split()

for i in range(n):
    list[i] = int(list[i]) - (i + 1)

b = int(median(list))

for i in range(n):
    list[i] = abs(list[i] - b)

print(sum(list))
# -*- coding: utf-8 -*-
from collections import deque
from heapq import heappush, heappop, heapify, merge
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
def inpl(): return tuple(map(int, input().split()))
 
N, M = inpl()
A = inpl()
tree = [[-1, 1]  for _ in range(N)] # [next, rank]
 
def find(i):
    if tree[i][0] == -1:
        group = i
    else:
        group = find(tree[i][0]) 
        tree[i][0] = group
    return group
  
def unite(x, y):
    px = find(x)
    py = find(y)
      
    if tree[px][1] == tree[py][1]: # rank is same
        tree[py][0] = px
        tree[px][1] += 1
    else:
        if tree[px][1] < tree[py][1]:
            px, py = py, px
        tree[py][0] = px
  
for _ in range(M):
    x, y = tuple(map(int, input().split()))
    if not int(find(x) == find(y)):
        unite(x, y)
 
D = defaultdict(list)
for n in range(N):
    D[find(n)].append(A[n])
 
H = []
S = [] # single

for k, v in D.items():
    if len(v) == 1:
        S.append(v)
    else:
        H.append(sorted(v))
 
heapify(H)
heapify(S)
 
res = 0 
while True:
    if (len(H) == 0) or (len(S) + len(H) <= 1):
        break
    

    
    A = heappop(H)
    B = heappop(H)
    
    if len(S) > 0:
        D = heappop(S)    
        if D[0] < B[0]:
            heappush(H, B)
            B = D
        else:
            heappush(S, D)
 
    res += A[0] + B[0]
    C = list(merge(A[1:], B[1:]))
 
    if len(C) == 1:
        heappush(S, C)
    else:
        heappush(H, C)
 
ok = True
if len(S) > 2:
    print("Impossible")
    ok = False
elif len(S) == 2:
    res += S[0][0]+S[1][0]
elif len(S) == 1:
    A = S[0]
    if len(H) == 1:
        B = heappop(H)
        res += A[0] + B[0]
else:
    pass
if ok:
    print(res)

### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
def inpl(): return tuple(map(int, input().split()))
 
N, M = inpl()
A = inpl()
tree = [[-1, 1]  for _ in range(N)] # [next, rank]
 
def find(i):
    if tree[i][0] == -1:
        group = i
    else:
        group = find(tree[i][0]) 
        tree[i][0] = group
    return group
  
def unite(x, y):
    px = find(x)
    py = find(y)
      
    if tree[px][1] == tree[py][1]: # rank is same
        tree[py][0] = px
        tree[px][1] += 1
    else:
        if tree[px][1] < tree[py][1]:
            px, py = py, px
        tree[py][0] = px
  
for _ in range(M):
    x, y = tuple(map(int, input().split()))
    if not int(find(x) == find(y)):
        unite(x, y)
 
D = defaultdict(list)
for n in range(N):
    D[find(n)].append(A[n])
 
H = []
res = 0 

for k, v in D.items():
    v = sorted(v)
    res += v[0]
    H.extend(v[1:])
 
if N < 2*(N-M-1):
    print("Impossible")
elif M == N-1:
    print(0)
else:
    res += sum(sorted(H)[:2*(N-M-1) - len(D.keys())])
    print(res)
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
MOD = 10 ** 9 + 7
 
ans = 0
# 各Aiについて、それが最小値になるような選び方が何通りあるかを求めながら計算
for i in range(N - K + 1):
    ans -= A[i] * nCr(N - i - 1, K - 1) % MOD
    ans %= MOD
 
# 各Aiについて、それが最小値になるような選び方が何通りあるかを求めながら計算
A = A[::-1]  # 大きい順に並び替え！
for i in range(N - K + 1):
    ans += A[i] * nCr(N - i - 1, K - 1) % MOD
    ans %= MOD
 
print(ans % MOD)


### FIXED CODE ###

n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
mod=10**9+7
ans=0
MOD=10**9+7

factorial = [1]
inverse = [1]
for i in range(1, n+2):
    factorial.append(factorial[-1] * i % MOD)
    inverse.append(pow(factorial[-1], MOD - 2, MOD))
 
 
# 組み合わせ計算
def nCr(n, r):
    if n < r or r < 0:
        return 0
    elif r == 0:
        return 1
    return factorial[n] * inverse[r] * inverse[n - r] % MOD
for i in range(n-k+1):
    ans-=a[i]*nCr(n-i-1,k-1)%mod
    ans%=mod
a=a[::-1]
for i in range(n-k+1):
    ans+=a[i]*nCr(n-i-1,k-1)%mod
    ans%=mod

print(ans%mod)
# AtCoder Regular Contest 080
    # C - 4-adjacent

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

    oddcount=0
    mod40=0
    other=0

    for a in alist:
        if a%2==1:
            oddcount+=1
        elif a%4==0:
            mod40+=1
        else:
            other+=1

    if N==1:
        if mod40==N:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    if N==2 or N==3:
        if mod40>0 or other==N:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    # ↑ここまではあってそう。

    if N%2==1:
        if (N-((other//2)*2))//2 <= mod40:
            print("Yes")
            exit()
        else:
            print("No")
            exit()

    else:
        if other%2==1:
            if (N-other)//2<=mod40:
                print("Yes")
                exit()
            else:
                print("No")
                exit()
        else:
            if (N-other)//2<mod40:
                print("Yes")
                exit()
            else:
                print("No")
                exit

### FIXED CODE ###

# AtCoder Regular Contest 080
# C - 4-adjacent

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

oddcount=0
mod40=0
other=0

for a in alist:
    if a%2==1:
        oddcount+=1
    elif a%4==0:
        mod40+=1
    else:
        other+=1

if N==1:
    if mod40==N:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
if N==2 or N==3:
    if mod40>0 or other==N:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
# ↑ここまではあってそう。

if N%2==1:  # N>3 ,Nが奇数の時
    if (N-((other//2)*2))//2 <= mod40:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

else:   # N>3 ,Nが偶数の時
    if other%2==1:  #かつ、要素が偶数である数が奇数の時  
        if (N-((other//2)*2))//2 <= mod40:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        if (N-((other//2)*2))//2 <= mod40:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
from math import gcd


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


A, B, C, D = map(int, input().split())
print(B - A + 1 - (B // C - (A - 1) // C + B // D - (A - 1) // D - (B // (lcm(C, D) - (A - 1) // lcm(C, D)))))


### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


A, B, C, D = map(int, input().split())
c = B // C - (A - 1) // C
d = B // D - (A - 1) // D
c_d = B // lcm(C, D) - (A - 1) // lcm(C, D)
print(B - A + 1 - c - d + c_d)
N = int(input())
A = [int(i) for i in input().split()]
B = sorted(A.copy(), reverse=True)

ans = 1
counts = [N] * (B[0]+1)
t = B[-1]//2-1
t = t if t > 0 else 0
for d in range(B[0], t, -1):
    for b in B:
        if b % d == 0:
            counts[d] -= 1
            if d != b // d:
                counts[b//d] -= 1

    if counts[d] < 2:
        ans = d
        break

if ans == 1:
    for i in range(B[-1]//2, 0, -1):
        if counts[i] < 2:
            ans = i
            break

print(ans)

### FIXED CODE ###

# 解けなかった...orz

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

def gcd(i, j):
    if i <= 0:
        return j
    elif j <= 0:
        return i

    while i != j:
        if i < j:
            j %= i
            if j == 0: return i
        else:
            i %= j
            if i == 0: return j
    return i

# M = [0] * N
L = [0] * (N+1)
R = [0] * (N+1)
# L[0] = 0
# R[N] = 0

for i in range(N):
    L[i+1] = gcd(L[i], A[i])
    R[N-i-1] = gcd(R[N-i], A[N-i-1])

res = max(gcd(L[i], R[i+1]) for i in range(N))
print(res)