Problem:
 Score : 200 points    Problem Statement Determine if an N -sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.  You can use the following theorem:  Theorem : an N -sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.      Constraints  All values in input are integers.  3 \leq N \leq 10  1 \leq L_i \leq 100         Input Input is given from Standard Input in the following format:  N  L_1  L_2  ...  L_N       Output If an N -sided polygon satisfying the condition can be drawn, print Yes ; otherwise, print No .        Sample Input 1 4
3 8 5 1      Sample Output 1 Yes  Since 8 < 9 = 3 + 5 + 1 , it follows from the theorem that such a polygon can be drawn on a plane.       Sample Input 2 4
3 8 4 1      Sample Output 2 No  Since 8 \geq 8 = 3 + 4 + 1 , it follows from the theorem that such a polygon cannot be drawn on a plane.       Sample Input 3 10
1 8 10 5 8 12 34 100 11 3      Sample Output 3 No

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in sys.stdin.readline().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    N = int(input())
    L = li_input()

    x = max(L)
    i = L.index(x)
    L_ = L[:i] + L[i+1:]

    if x < sum(L_):
        print("Yes")
    else:
        print("No")


main()

Solution (Python):


N = int(input())
L = list(map(int, input().split()))
total = sum(L)

if total - max(L) > max(L):
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
l = list(map(int,input().split()))

longest = max(l)
total = sum(l) - longest

if longest < total:
    print("Yes")
else:
    print("No")

Solution (Python):
k = int(input())
a = 0
data = list(map(int, input().split()))
data = sorted(data)

for num in range(len(data)-1):
    a += data[num]


if data[-1] < a:
    print('Yes')
else:
    print("No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
maxL = max(L)
L.remove(maxL)
print('Yes' if maxL < sum(L) else 'No')

Solution (Python):
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
total=sum(arr[:-1])
if arr[-1]<total:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
L = sorted(L)
Sum = 0
for i in range(N-1):
    Sum += L[i]
if L[N-1]<Sum:
    print("Yes")
else:
    print("No")

Solution (Python):
import numpy as np

N = int(input())
L = np.array([int(s) for s in input().split(' ')])

print('Yes' if np.max(L) < np.sum(L) - np.max(L) else 'No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
if max(L) * 2 < sum(L):
	print('Yes')
else:
	print('No')

Solution (Python):
import sys

def ii2ss(n):
    return [sys.stdin.readline() for _ in range(n)]

def sp2nn(sp, sep=' '):
    return [int(s) for s in sp.split(sep)]

def ss2nn(ss):
    return [int(s) for s in list(ss)]

import functools as ft

def main2(L):
    L.sort()
    lmax = L[-1]
    lothers = ft.reduce(lambda x, y: x + y, L[:-1])
    b = lmax < lothers
    return 'Yes' if b else 'No'

def main(ss):
    L = sp2nn(ss[1])
    s = main2(L)
    print(s)

main(ii2ss(2))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

flag = True
for i in range(n):
    if sum(l) - l[i] > l[i]:
        pass
    else:
        flag = False

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

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
L.sort(reverse=True)
if L[0]<sum(L[1:]):
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
L = sorted(map(int, input().split()))


if L[N-1] >= sum(L) - L[N-1]: 
  print("No")
else:
  print("Yes")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort(reverse=1)
length = 0

for i in range(1,N):
  length += L[i]
  
if L[0]<length:
  print("Yes")
else:
  print("No")

Solution (Python):


N = int(input())
L = input().split()
L_num = []

for i in range(len(L)):
    L_num.append(int(L[i]))

L_num.sort()

total = 0
for j in range(len(L) - 1):
    total += L_num[j]

if total <= L_num[N-1]:
    print("No")
else:
    print("Yes")

Solution (Python):

N = int(input())
Ln = list(map(int, input().split()))
Ln.sort(reverse=True)
max = Ln[0]
sum = sum(Ln)
    
if max < sum - max:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()
if 2 * l[-1] < sum(l):
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=list(map(int, input().split()))
print("Yes" if max(l) < sum(l)-max(l) else "No")

Solution (Python):
N=int(input())
sides=[int(i) for i in input().split()]
M=max(sides)
sides.sort()
sides=sides[0:N-1]
K=sum(sides)
if M<K:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))

L.sort()

lmax = max(L)
L.pop()
lsum = 0

for i in range(N-1):
    lsum += L[i]

if lsum > lmax:
    print('Yes')
elif lsum <= lmax:
    print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
print("Yes" if max(L) < sum(L)-max(L) else "No")

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
long = max(l)
if sum(l) - long > long:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
sum = 0
for i in range(N-1):
    sum += L[i]
if sum > L[N-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
l = sorted(l)
m = l.pop(len(l)-1)
if m >= sum(l):
  print("No")
else:
  print("Yes")

Solution (Python):
N = int(input())
Ls = map(int, input().split(" "))
L_lst = sorted(Ls)
if L_lst[-1] >= sum(L_lst[:-1]):
  print("No")
else:
  print("Yes")

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
Sum=sum(L)
print('Yes' if all(2*l < Sum for l in L) else 'No')

Solution (Python):


n = int(input())

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

a.sort()

b = a.pop(-1)
 
if b < sum(a):
    print('Yes')
else:
    print('No')

Solution (Python):
N=int(input())
l=list(map(int,input().split()))
if max(l)<sum(l)-max(l):
	print("Yes")
else:
	print("No")

Solution (Python):
input()
l = sorted(map(int, input().split()))
m=l.pop()
t=sum(l)
print("Yes" if m<t else "No")

Solution (Python):
N=int(input())
l=list(map(int,input().split()))
if(max(l)<(sum(l)-max(l))):
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
print("Yes" if sum(l)-max(l)>max(l) else "No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort()

if L[-1] < sum(L[:-1]):
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]

l.sort()

max = l[-1]
l_sum = sum(l)

if l_sum - 2*max > 0:
  print('Yes')
else:
  print('No')

Solution (Python):
_,a=open(0);*a,=map(int,a.split());print('YNeos'[sum(a)<=max(a)*2::2])

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]

a = sorted(a)
b = a.pop(-1)

aa = sum(a)

print('Yes' if aa> b else 'No')

Solution (Python):
n = int(input())
a = [ int(i) for i in input().split() ]
a = sorted(a)
if sum(a[:-1]) > a[-1]:
  print("Yes")
else:
  print("No")

Solution (Python):
input()
L = list(map(int,input().split()))
if max(L) < sum(L)-max(L):
    print('Yes')
else:print('No')

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
if sum(b)>2*max(b):
       print("Yes")
else:
       print("No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
print('Yes' if max(L) < sum(L)-max(L) else 'No')

Solution (Python):
n = int(input())
ar = list(map(int, input().split()))

try:
	assert 3 <= n <= 10
	assert len(ar) == n
	assert (1 <= min(ar)) and (max(ar) <= 100)
except:
	print("No")
else: 
	if max(ar) < (sum(ar) - max(ar)):
	  print("Yes")
	else:
	  print("No")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
if sum(L) > 2*max(L):
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
L = [int(x) for x in input().split()]

lmax = max(L)
lsum = sum(L) - lmax

if lmax < lsum:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
Ls = sorted(list(map(int, input().split())))

sum = 0
for i in range(N-1):
    sum += Ls[i]

if sum > Ls[-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
import numpy as np
n = int(raw_input())
l = map(int, raw_input().split())
l = np.array(l)
if np.sum(l) > max(l) * 2:
	print 'Yes'
else:
	print 'No'

Solution (Python):
n = int(input())
x = list(map(int, input().split()))

x.sort()

print("Yes" if x[-1] < sum(x[:-1]) else "No")

Solution (Python):
n=int(input())
lists=list(map(int,input().split()))
lists.sort()
a=0
for i in range(0,n):
  a=a+lists[i]
if a-lists[n-1]>lists[n-1]:
  print("Yes")
else:
  print("No")

Solution (Python):
import numpy as np
N = int(input())
L = list(map(int, input().split()))
sorted_L = sorted(L)
if 2*sorted_L[N - 1] < sum(sorted_L):
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
sum_L = sum(L) - max(L)

if max(L) < sum_L:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
l = list(map(int, input().split()))
print("Yes" if sum(l) - max(l) > max(l) else "No")

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
print("Yes" if sum(l) - max(l) > max(l) else "No")

Solution (Python):
N = input()
A = list(map(int, input().split()))
A.sort()
if A[-1] < sum(A[:-1]):
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
L=list(map(int, input().split()))
k = 0
m = 0
for i in range(len(L)):
  k = max(k,L[i])
  m = m + L[i]
M = m -k
if(M>k):
  print('Yes')
else:
  print('No')

Solution (Python):
a= input()
b = input().split()
b = [int(s) for s in b]
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-int(max(b))>int(max(b)):
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
l = sorted(list(map(int, input().split())))
ans = 'Yes' if l.pop() < sum(l) else 'No'
print(ans)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Solution (Python):
input()
l = list(map(int, input().split()))
l.sort(reverse = True)
print('Yes' if l[0] < sum(l[1:]) else 'No')

Solution (Python):
x = int(input())
y = [int(i) for i in input().split(' ')]
if x == len(y):
  ma = max(y)
  del (y[y.index(max(y))])
  other = sum(y)
  if ma - other < 0:
    print('Yes')
  else: 
    print('No')
else:
  print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

m = max(L)
s = sum(L)
if m < (s - m):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))

if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

l_sum = sum(L)
l_max = max(L)

if l_max < l_sum - l_max:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
L_list = [int(i) for i in input().split()]
longest = max(L_list)
L_list.remove(longest)
if longest < sum(L_list):
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
	n = int(input())
	x = list(map(int, input().split()))
	max_x = 0
	total = 0
	for xi in x:
		total += xi
		if xi > max_x:
			max_x = xi
	if max_x < total - max_x:
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
    main()

Solution (Python):

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


ans = 'Yes' if 2 * max(L) < sum(L) else 'No'
print(ans)

Solution (Python):
N=int(input())
L=[int(x) for x in input().split()]

L.sort()

if L[-1] < sum(L[:-1]):
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort()

if sum(L[:-1]) > L[-1]:
    ans = "Yes"
else: ans = "No"

print(ans)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()
sum = 0
for i in l:
    sum += i
sum -= l[-1]
if sum > l[-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
print("Yes" if sum(L[0:-1]) > L[-1] else "No")

Solution (Python):
n = int(input())
ls = list(map(int,input().split()))

max_ls = max(ls)

sum_ls = sum(ls)


if sum_ls - max_ls > max_ls :
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()

if (sum(L) - 2*L[-1] > 0):
	print("Yes")
else:
	print("No")

Solution (Python):
N = int(input())
Z = [int(s) for s in input().split()]
if max(Z) < sum(Z)-max(Z):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())

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

if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
l = list(map(int,input().split()))
l.sort(reverse=True)
long = l[0]
l.pop(0)
if long < sum(l):
    print("Yes")
else:
    print("No")

Solution (Python):
input();*a,=map(int,input().split());print("YNeos"[sum(a)<=max(a)*2::2])

Solution (Python):
N = int(input())
L = [int(_) for _ in input().split()]
L.sort()
s = 0
for i in range(N-1):
  s += L[i]
if L[N-1] < s:
  print("Yes")
else:
  print("No")

Solution (Python):
input();*a,b=sorted(map(int,input().split()));print("YNeos"[sum(a)<=b::2])

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
m=max(a)
if 2*m<sum(a): print("Yes")
else: print("No")

Solution (Python):
N = int(input())
L = []
L = list(map(int, input().split()))

M = max(L)
L.remove(M)
if M < sum(L):
	print('Yes')
else:
	print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
print('Yes') if max(L) * 2 < sum(L) else print('No')

Solution (Python):


import math
import sys
input = sys.stdin.readline

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

L.sort(reverse=True)
longest = L[0]
others = sum(L[1:])

print("Yes" if longest < others else "No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
L.sort()
max_L = L[-1]
del L[-1]
if max_L >= sum(L):
    print("No")
else:
    print("Yes")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

l_max = max(L)
L.remove(l_max)

if sum(L) > l_max:
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
    N = int(input())
    *L, = map(int, input().split())
    maxi = L.pop(L.index(max(L)))
    accum = 0
    for i in L:
        accum += i
    if maxi < accum:
        print("Yes")
    else:
        print("No")

main()

Solution (Python):
n=int(input())
hen=list(map(int,input().split()))


hen.sort()
a=sum(hen)
b=a-int(hen[n-1])
if hen[n-1]>=b:
    print("No")
else:
    print("Yes")

Solution (Python):
n = input()

l = [int(i) for i in input().split()] 
maximum = max(l)

if((sum(l) - maximum) > maximum):
    print("Yes")
else:
    print("No")

Solution (Python):
a=input()
l=list(map(int,input().split()))
print("Yes" if 2*max(l)<sum(l) else "No")

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
li = na()
print("Yes" if max(li) < sum(li) - max(li) else "No")

Solution (Python):
_ = input()
l = [int(i)for i in input().split()]
print("Yes" if 2*max(l) < sum(l) else "No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
maxL = max(L)
sumL = sum(L)
if maxL >= sumL - maxL:
    print("No")
else:
    print("Yes")

Solution (Python):
N = int(input())
l = [int(i) for i in input().split()]
max_side = max(l)
total = sum(l)
d = total - max_side
print("Yes" if d>max_side else "No")

Solution (Python):
N = int(input())  

L = list(map(int, input().split()))  
L.sort(reverse=True)

max_L = L[0]

sum = 0
for i in range(1, len(L)):
    sum += L[i]

if max_L < sum:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
L = list(map(int,input().split()))

if max(L) < sum(L) - max(L):
	print("Yes")
else:
	print("No")

Solution (Python):
N = int(input())
Ls = [int(x) for x in input().split()]

L = max(Ls)
ans = L < (sum(Ls) - L)

print("Yes" if ans else "No")

Solution (Python):



N = int(input())
l = sorted(list(map(int, input().split())))
print('Yes' if l[-1] < sum(l) - l[-1] else 'No')

Solution (Python):


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

l.sort()

if l[-1] < sum(l[:-1]):
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
L = [int(x) for x in input().split()]

max_l = max(L)

if 2*max_l < sum(L):
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
if L[-1] < sum(L[0:-1]):
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
L_list = list(map(int,input().split()))
if max(L_list) < sum(L_list)-max(L_list):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
l_li = list(map(int, input().split()))
l_li.sort()
count = 0
for i in range(N - 1):
    count += l_li[i]
if l_li[-1] < count:
    print("Yes")
else:
    print("No")

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

a.sort()

if a.pop() < sum(a):
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=sorted(list(map(int,input().split())))
length=0
for i in range(len(l)-1):
  length+=l[i]
if length>l[-1]:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]
Max = max(L)
L.remove(Max)
if(Max >= sum(L)):
    print("No")
else:
    print("Yes")

Solution (Python):
input()
L = [int(i) for i in input().split()]

L = sorted(L)
print('Yes' if L[-1] < sum(L[:-1]) else 'No')

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L = sorted(L)
m = L.pop(-1)
if sum(L) > m:
  print("Yes")
else:
  print("No")

Solution (Python):


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

if max(L) < sum(L) - max(L):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(raw_input())
L = map(int, raw_input().split())
L.sort()

sum = 0
for i in range(0, N-1):
	sum += L[i]

if L[N-1] < sum: print 'Yes'
else: print 'No'

Solution (Python):
n = int(input())
length = list(map(int, input().split()))
print('Yes') if max(length) < sum(sorted(length)[:len(length)-1]) else print('No')

Solution (Python):
N = int(input())

L = sorted([int(i) for i in input().split(' ')])
if sum(L[0:N-1]) > L[N-1]:
  print('Yes')
else:
  print('No')

Solution (Python):
n,ans,l=int(input()),"Yes",list(map(int,input().split()))
for i in l:
  if sum(l)<=i*2:ans="No"
print(ans)

Solution (Python):
n = int(input())
l = sorted(map(int, input().split()))

sum = 0

for i in range(n - 1):
    sum += l[i]

if l[n - 1] < sum:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()

sum = 0

for i in range(n - 1):
    sum += l[i]

if l[n - 1] < sum:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

def main():
    L_sum = 0
    L_max = 0
    for l in L:
        if l > L_max:
            L_max = l
        L_sum += l
    if L_max < L_sum - L_max:
        return 'Yes'
    else:
        return 'No'

if __name__ == '__main__':
    print(main())

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
if sum(L) > 2 * max(L):
	print('Yes')
else:
	print('No')

Solution (Python):
n = int(input())
li = list(map(int, input().split()))

if max(li) < sum(li)-max(li):
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
li = list(map(int, input().split()))
a = max(li) < sum(li)-max(li)

if a:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
a = max(l)
l.remove(a)
b = 0
for i in range(len(l)):
    b += l[i]
if a < b:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L_list = [int(i) for i in input().split()]

l_max = max(L_list)
del L_list[L_list.index(l_max)]
if l_max < sum(L_list):
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
L = list(map(int,input().split()))

ans = "Yes"
for i in range(N):
  L[i+1:], L[i] ,L[:i]
  if sum(L[i+1:]+L[:i]) <= L[i]:
    ans = "No"
print(ans)

Solution (Python):
n,*p=map(int,open(0).read().split())
p=sorted(p)
if sum(p[:-1])>p[-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
a=sum(l)
ans='Yes'
for i in l:
  if a-i<=i:
    ans='No'
print(ans)

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]

if 2 * max(L) < sum(L):
    print("Yes")
else:
    print("No")

Solution (Python):
input()
L = sorted(map(int, input().split()))
print("Yes" if L[-1] < sum(L[:-1]) else "No")

Solution (Python):
N = int(input())
length = list(map(int,input().split()))
l1 = max(length)
sum = 0
for i in length:
    sum += i
if 2*l1 < sum:
    print("Yes")
else:
    print("No")

Solution (Python):
N = map(int,input())
L = list(map(int,input().split()))
if sum(L)-max(L)>max(L):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
ls = [int(i) for i in input().split()]

l = max(ls)
ls.remove(l)
if l >= sum(ls):
    print("No")
else:
    print("Yes")

Solution (Python):

N = int(input().strip())
L = list(map(int, input().strip().split()))

l_max = max(L)
l_sum = sum(L) - l_max
if l_max < l_sum:
	print('Yes')
else:
	print('No')

Solution (Python):
N=int(input());*A,=map(int,input().split());print("YNeos"[sum(A)<=max(A)*2::2])

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
max_a = max(a)
a.remove(max_a)
if(max_a < sum(a)):
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
lists=list(map(int,input().split()))
a=1
b=0
for i in range (1,n+1):
  b=b+lists[i-1]
for j in range (1,n+1):
  if 2*lists[j-1]>=b:
    a=0
if a==0:
  print("No")
else:
  print("Yes")

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
if l[0] < sum(l[1:]):
    print("Yes")
else:
    print("No")

Solution (Python):
N=int(input())
Ls=list(map(int, input().split()))
Ls = sorted(Ls, reverse=True)
Lmax=Ls[0]
Lsum=0
for i in range(1,N):
    Lsum+=Ls[i]
if Lmax < Lsum:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
t = list(map(int, input().split()))
if max(t) * 2 < sum(t):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

maxlen = max(L)
L.remove(max(L))

if sum(L) > maxlen:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
l = list(map(int, input().split()))

l.sort()

if l[n-1] < sum(l[:n-1]):
  print("Yes")
else:
  print("No")

Solution (Python):
n = input()
l = list(map(int,input().split()))

if max(l) < sum(l)-max(l):
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
if sum(l)>max(l)*2:
  print("Yes")
else:
  print("No")

Solution (Python):
a = int(input())
b = sorted(list(map(int,input().split())),reverse=True)
if sum(b)-2*b[0]>0:
    print("Yes")
else:
    print("No")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(N: int, L: "List[int]"):
    L.sort()
    if L[-1] < sum(L[:-1]):
        print(YES)
    else:
        print(NO)
    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))  
    L = [ int(next(tokens)) for _ in range(N) ]  
    solve(N, L)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
l_list = [int(i) for i in input().split()]
max_l = max(l_list)
sum_l = sum(l_list) - max_l*2
if sum_l > 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=list(map(int, input().split()))
print("Yes" if (sum(l)>max(l)*2) else "No")

Solution (Python):
N = int(input())
length_list = input().split()
length_list = [int(i) for i in length_list]
length_list.sort()
if length_list[-1] < sum(length_list[0:-1]):
    print('Yes')
else:
    print('No')

Solution (Python):

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

if(2*max(a)<sum(a)):
    print("Yes")
else:
    print("No")

Solution (Python):

N = int(input())
X = [int(i) for i in input().split()]
print("Yes" if max(X) < sum(X)-max(X) else "No")

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
m = max(a)
if 2*m<sum(a):
  print('Yes')
else:
  print('No')

Solution (Python):
number = input()
lines = [int(x) for x in input().split(" ")]

if (sum(lines)-max(lines)) > max(lines):
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
A_theorem = sum(L) - L[N-1]
if A_theorem > L[N-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
if max(L) < (sum(L)-max(L)):
    print("Yes")
else:
    print("No")

Solution (Python):

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

lmax = max(L)
maxidx = L.index(lmax)

suml = 0
for i in range(N):
    if i != maxidx:
        suml += L[i]
        
if lmax < suml:
    print('Yes')
else :
    print('No')

Solution (Python):
n = int(input())
L = list(map(int, input().split()))
Lmax = max(L)
L.remove(Lmax)
print('Yes' if Lmax < sum(L) else 'No')

Solution (Python):
n = int(input())
l = list(map(int,input().split()))

m = max(l)
s = 0

for i in range(0,n):
    s = s + l[i]

s = s - m

if m < s:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
L = [int(_) for _ in input().split()]

L = sorted(L)
print("Yes" if sum(L) > 2*L[-1] else "No")

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]

L = sorted(L, reverse=True)

if L[0] < sum(L[1:]):
    print('Yes')
else:
    print('No')

Solution (Python):
n=input()
l=list(map(int,input().split()))
if max(l)*2<sum(l):print('Yes')
else:print('No')

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
m = l[:]
c = 0

for i in range(n):
    m.remove(m[i])
    if l[i] >= sum(m):
        c = 1
        break
    m = l[:]

if c == 1:
    print("No")
else:
    print("Yes")

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

if max(l) < sum(l) - max(l):
    print("Yes")
else:
    print("No")

Solution (Python):


if __name__ == "__main__":
    N = int(input())
    L=map(int, input().strip().split())
    L=sorted(L)
    s = sum(L[:-1])
    if s > L[-1]:
        print("Yes")
    else:
        print("No")

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
if sum(l[:-1]) > l[-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
L=max(l)
other=sum(l)-L
if other<=L:
  print('No')
else:
  print('Yes')

Solution (Python):
N=int(input())
Ls=input().split()
L=[int(i) for i in Ls]
mx=max(L);L.remove(mx)
all=0
for j in L:all+=j
if all>mx:print("Yes")
else:print("No")

Solution (Python):
n = int(input())
x = list(map(int, input().split()))
if(2*max(x) < sum(x)) : print("Yes")
else : print("No")

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]

m = max(L)
if m < sum(L)-m:
    print('Yes')
else:
    print('No')

Solution (Python):
trash = input()
input_1 = list(map(int,input().split(' ')))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

Solution (Python):
import sys

n = int(input())

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

for i in range(n):
    if l[i] >= sum(l) - l[i]:
        print("No")
        sys.exit()

print("Yes")

Solution (Python):
n = int(input())
s = list(map(int, input().split()))
s.sort()
t = 0
for i in range(len(s) -1):
  t += s[i]
if(s[-1] >= t):
  print("No")
else:
  print("Yes")