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-----
4
3 8 5 1

-----Sample Output-----
Yes

Since 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.

Difficulty: introductory

Starter code:

Solutions:
_n = input()
lines = list(map(int, input().split()))
lines.sort()
longest = lines.pop()
if sum(lines) > longest:
  print("Yes")
else:
  print("No")

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


N = int(input())
l = list(map(int,input().split()))
sum = 0
flg = True

for i in range(N):
    sum = sum + l[i]
    
for j in range(N):
    if sum - l[j] <= l[j]:
        flg = False
        break
            
if flg == True:
    print("Yes")
else:
    print("No")

polygon_side = int(input())
side_length = list(map(int, input().split()))
if max(side_length) * 2 < sum(side_length):
    print('Yes')
else:
    print('No')

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

all_l = sum(l)
max_l = max(l)

com = all_l - max_l

if(com > max_l):
    print('Yes')
else:
    print('No')


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

N = input()
num = list(map(int, input().split(' ')))
max_num = max(num)
num.remove(max_num)
num_sum = 0
for i in num:
    num_sum += i
if max_num < num_sum:
    print('Yes')
else:
    print('No')

N,*L=map(int,open(0).read().split());print('NYoe s'[2*max(L)<sum(L)::2])

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

L = sorted(L)

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

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

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

N = int(input())
S = map(int,input().split())
length_list = list(S)
length_list.sort(reverse=True)
# print(length_list)
max_length = length_list.pop(0)
# print(max_length)

if max_length < sum(length_list):
    print("Yes")
else:
    print("No")

import sys
input = sys.stdin.readline


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

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


def __starting_point():
    main()


__starting_point()

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

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

def answer(n: int, l: list) -> str:
    if max(l) < (sum(l) - max(l)):
        return 'Yes'
    else:
        return 'No'

print(answer(n, l))

n = int(input())
a = list(map(int, input().split()))
m = 0
t = 0
for i in range(n):
  m += a[i]
for i in range(n):
  t += 2*a[i] >= m
if t == 0:
  print("Yes")
else:
  print("No")

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

max = 0
kei = 0

for i in range(len(data)):
    kei += data[i]
    if max < data[i]:
        max = data[i]

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

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

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

L.sort()
if sum(L[:-1]) > L[-1]:
  print('Yes')
else:
  print('No')

n = int(input())
l = list(map(int,input().split()))
l.sort()
mx = l.pop()
print("Yes" if sum(l) > mx else "No")

# listを並び替えてif-elseで条件分岐


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

descending_L = sorted(L, reverse=True)
# print(descending_L)

other_side = sum(descending_L[1:])

if descending_L[0] < other_side:
    print('Yes')
else:
    print('No')



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

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



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

# 定理 : 一番長い辺が他の N−1 辺の長さの合計よりも真に短い場合に限り、条件を満たすN角形が描ける。
# 条件を満たすN角形が描けるなら Yes、そうでないなら No を出力せよ。

short_len = sum(len) - max(len)
result = 'Yes' if short_len > max(len) else 'No'
print(result)

#https://atcoder.jp/contests/abc117/tasks/abc117_b
S_list = [input() for i in range(2)]
N = list(map(int,S_list[0].split()))    
L_list = list(map(int,S_list[1].split()))

L_max = max(L_list)
L_sum = sum(L_list) - L_max
if L_sum - L_max > 0:
    result ="Yes"
else:
    result ="No"
print(result)


# NとL1〜Lnを標準入力で受け取る
a = [input().split() for l in range(2)]
N = int(a[0][0])
L = a[1]

# L1〜Lnの和を求める
sum = 0
for i in range(N):
    sum += int(L[i])

# L1〜Lnの各辺に対して定理が成立するかを確かめる
l_tf = []
for i in range(N):
    if 2 * int(L[i]) >= sum:
        l_tf.append(1)
    else:
        l_tf.append(0)

if all([i == 0 for i in l_tf]):
    print('Yes')
else:
    print('No')

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

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

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

Notmax_widths = sum(widths) - max(widths)
result = 'Yes' if Notmax_widths > max(widths) else 'No'
print(result)

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

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

n = int(input())
long = list(map(int,input().split()))
one = max(long)
ans = sum(long) - one

if ans > one :
  print("Yes")
else:
  print("No")

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


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

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

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

n = int(input())
list01 = input().split()
list02 = sorted([int(s) for s in list01])
a = sum(list02) - list02[-1]
if list02[-1] < a:
    print('Yes')
else:
    print('No')

n = int(input())
l = list(map(int,input().split()))
l.sort()
if sum(l[0:n-1]) > l[n-1]:
    print('Yes')
else:
    print('No')

# 117b

def atc_117b(N: int, Li_input: str) -> str:
    Li = [int(i) for i in Li_input.split(" ")]
    Li = sorted(Li)
    max_length = Li.pop()
    if max_length < sum(Li):
        return "Yes"
    return "No"

N_input_value = int(input())
Li_input_value = input()
print((atc_117b(N_input_value, Li_input_value)))



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

N = int(input())
L = list(map(int,input().split()))
a = max(L)
L.remove(a)
s = 0
for i in L:
    s += i

if a < s:
    print('Yes')
else:
    print('No')

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

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

def generate_polygon(length: list) -> str:
    length.sort()
    len_max = length.pop()
    len_sum = sum(length)
    if len_max < len_sum:
        return "Yes"
    return "No"


def __starting_point():
    n = int(input())
    length = list(map(int, input().split()))
    print((generate_polygon(length)))

__starting_point()

def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    l = sorted(Input())
    x, y = sum(l[:-1]), l[-1]
    print("Yes" if y < x else "No")


main()

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


# NとL1〜Lnを標準入力で受け取る
a = [input().split() for l in range(2)]
N = int(a[0][0])
L = a[1]

# L1〜Lnの和を求める
sum = 0
for i in range(N):
    sum += int(L[i])

# L1〜Lnの各辺に対して定理が成立するかを確かめる
l_tf = []
for i in range(N):
    if 2 * int(L[i]) >= sum:
        print('No')
        break
else:
    print('Yes')

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

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

N = int(input())

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

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

n,*l=map(int,open(0).read().split())
l.sort(reverse=True)
print("Yes" if l[0]<sum(l[1:]) else "No")

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

theory = (max(L) < (sum(L) - max(L)))

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

u = input()
length = list(input().split())
h = [int(i) for i in length]

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

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

#print(L[-1],sum(L[:-1]))

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

n = int(input())
l = list(map(int, input().split()))
m = max(l)
l.remove(m)
print(('Yes' if m < sum(l) else 'No'))


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

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


num = int(input())
edges = list(map(int, input().split(' ')))
can_draw = 0
edges.sort(reverse=True)
if edges[0] < sum(edges[1:]):
  print("Yes")
else:
  print("No")

N=int(input())
L=list(map(int,input().split()))
m=max(L)
L.pop(L.index(max(L)))
if m<sum(L):
    print('Yes')
else:
    print('No')

# B Polygon
N = int(input())
L = list(map(int, input().split()))
mx = L.pop(L.index(max(L)))
if mx < sum(L):
    print("Yes")
else:
    print("No")
pass



# 117b

def atc_117b(N: int, Li_input: str) -> str:
    Li = [int(i) for i in Li_input.split(" ")]
    Li = sorted(Li)
    max_length = Li.pop()
    if max_length < sum(Li):
        return "Yes"
    return "No"


N_input_value = int(input())
Li_input_value = input()
print(atc_117b(N_input_value, Li_input_value))

n=int(input())
l=list(map(int, input().split()))
sum=0
for i in range(n):
  sum+=l[i]
print("Yes" if max(l)*2<sum else "No")

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

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


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

ans = 0
for i in range(N):
	ans += L[i]
if max(L) < sum(L)-max(L):
	print("Yes")
else:
	print("No")


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

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

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

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



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

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

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

li.sort()

su = sum(li)
if li[n-1] < su - li[n-1]:
    print('Yes')
else:
    print('No')

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

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

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

length = 0

for i in range(0, N):
    length += L[i]

length -= max(L)

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

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

data_2 =(max(data) < (sum(data)-max(data)))

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

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

for i in range(N):
    sum=0
    for j in range(N):
        if i==j:
            continue
        else:
            sum+=L[j]
    if L[i]>=sum:
        ans=False
if ans==True:
    print('Yes')
else:
    print('No')


N = list(map(int,input().split()))
side = list(map(int, input().split()))
long_side = max(side)
total = 0
for i in side:
    total += i

total -= long_side

if long_side < total:
    print('Yes')
else:
    print('No')


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

# 一番長い辺が他のN−1辺の長さの合計よりも真に短い場合に限り、条件を満たすN角形が描ける。
if sum(l) - max(l) > max(l):
    print("Yes")
else:
    print("No")

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

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

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

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

N = int(input())
L = list(map(int, input().split()))
long = max(L)
other = sum(L) - long

if long < other:
    print('Yes')
else:
    print('No')

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

M = max(L)
m = L.index(M)
s = sum(L[:m]) + sum(L[m+1:])

if M < s: print('Yes')
else: print('No')

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

terms = (max(l) < (sum(l) - max(l)))

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

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

edge_list.sort(reverse=True)
longest_edge = edge_list.pop(0)
left_sum = 0

for i in edge_list:
    left_sum += i

if longest_edge < left_sum:
    print('Yes')
else:
    print('No')


# import numpy as np
# import math

# from scipy.special import perm : perm(n, r, exact=True)
# from scipy.special import comb : comb(n, r, exact=True)

# import itertools
# for v in itertools.combinations(L, n):M.append(list(v))

# from numba import njit
# @njit('f8(i8,i8,i8,i8,f8[:,:,:])', cache=True)


""" Definitions  """

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

MOD = 10**9+7

# ============================================================

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

m = max(L)
L.remove(m)
s = sum(L)

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


n = int(input())
l = list(map(int, input().split()))
l.sort()
tmp = 0
for i in range(n-1):
    tmp += l[i]

if l[-1] < tmp:
    print('Yes')
else:
    print('No')

N = int(input())
N_List = list(map(int,input().split()))
maxN = max(N_List)

print(("No","Yes")[(sum(N_List)-maxN)>maxN])

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

max_l = max(l)
sum_l = sum(l) - max_l

if sum_l - max_l > 0:
    print('Yes')
else:
    print('No')



input()
L = list(map(int, input().split()))
print(('No', 'Yes')[sum(L) > max(L) * 2])

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

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

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

al_max = max(al)
al_sum = sum(al)

if al_sum - al_max *2 >0:
    print("Yes")
else:
    print("No")

#https://atcoder.jp/contests/abc117/tasks/abc117_b
S_list = [input() for i in range(2)]
N = map(int,S_list[0].split())    
L_list = list(map(int,S_list[1].split()))
 
if sum(L_list) > max(L_list) * 2:
    result ="Yes"
else:
    result ="No"
print(result)

# 数値の取得
polynum = int(input())
length = list(map(int,input().split()))

# 図形の成立可否を検証し結果を出力
most_l = max(length)
othersum = sum(length) - most_l
if othersum > most_l:
    print("Yes")
else:
    print("No")

polygon_side = int(input())
side_length = list(map(int, input().split()))
if max(side_length) * 2 < sum(side_length):
    print('Yes')
else:
    print('No')

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

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


def main():
    input()
    l = list(map(int, input().split()))
    m = max(l)
    s = sum(l) - m
    ans = 'Yes' if m < s else 'No'
    print(ans)

def __starting_point():
    main()

__starting_point()

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

l.pop(l.index(m))

if m < sum(l):
    print('Yes')
else:
    print('No')

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

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

n=int(input())
l=list(map(int,input().split()))
m=l.pop(l.index(max(l)))
if m<sum(l):
    print('Yes')
else:
    print('No')


# N
N = int(input())
my_list = list(map(int, (input().split(maxsplit=N))))

sorted_list = sorted(my_list, reverse=True)

num = 0
for i in range(1, len(my_list)):
    num += sorted_list[i]

if sorted_list[0] < num:
    answer = 'Yes'
else:
    answer = 'No'

print(answer)


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

L.sort()
length = 0
for i in range(N-1):
  length += L[i]
if length > L[N-1]:
  print('Yes')
else:
  print('No')

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

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

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

x=sum(L)
for l in L:
    if l>=x-l:
        print("No")
        break
else:
    print("Yes")


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