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



Sample input:
4
3 8 5 1


Sample output:
Yes

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = max(l)
nn = sum(l) - m
if nn > m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
L.sort(reverse=True)

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

Submission status: Accepted

Solution code:
input()
l = [int(i) for i in input().split()]
if sum(l) - max(l) > max(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int, input().split()))

lst.sort()

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

Submission status: Accepted

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

lmax = max(l)
lsum = sum(l) - lmax
ans = "No"
if lmax < lsum:
	ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
array = [int(x) for x in input().split()]
tmp = max(array)
print("Yes" if sum(array)-tmp > tmp else "No")

Submission status: Accepted

Solution code:
N = int(input())
lis = list(map(int, input().split()))

m = max(lis)
ind = lis.index(m)
s = 0
for i in range(len(lis)):
    if i == ind: pass
    else:
        s += lis[i]

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
Ln = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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


#%%
# n = 4
# l = [3, 8, 5, 1]



#%%
l.sort()

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

#%%

Submission status: Accepted

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

b = sum(a)
c = max(a)
b -= c

if b > c:
	print("Yes")

else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = input().split()
k = []
for i in l:
    k.append(int(i))
k.sort()
p = k[-1]
del(k[-1])
if sum(k) <= p:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()

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

Submission status: Accepted

Solution code:
#!/mnt/c/Users/moiki/bash/env/bin/python
# NM = map(int, input().split())
N = int(input())
L = list(map(int, input().split()))

L = sorted(L)
max_ = L[-1]
L = L[:-1]


print("Yes" if max_ < sum(L) else "No")

Submission status: Accepted

Solution code:
n=map(int,input().split())
*l,=map(int,input().split())

a=max(l)
b=sum(l)-a

print("Yes" if a<b else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ls = sorted([int(i) for i in input().split()])
# print(ls)
if ls[-1] < sum(ls[:-1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    Ls = list(map(int, input().split()))
    l_max = max(Ls)
    l_sum = sum(Ls) - l_max
    if l_max < l_sum:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
l = list(int(i) for i in input().split())
l = sorted(l, reverse=True)
rest = sum(l)-l[0]
if l[0]<rest:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def inpl(): return [int(i) for i in input().split()]
N = int(input())
L = inpl()
print(['No', 'Yes'][2*max(L) < sum(L)])

Submission status: Accepted

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

L.sort(reverse = True)
l = L[0]

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

Submission status: Accepted

Solution code:
N = int(input())
L_list = [int(elem) for elem in input().split()]

longest_edge = max(L_list)
sum_other_edges = sum(L_list) - longest_edge
if sum_other_edges > longest_edge:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

M = max(L)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
INF, MOD = float("inf"), 1e9 + 7
MAX, MIN = -INF, INF
dx1, dy1, dx2, dy2 = [-1, 0, 1, 0], [0, -1, 0, 1], [-1, 0, 1, -1, 1, -1, 0, 1], [-1, -1, -1, 0, 0, 1, 1, 1]

def get_int():
    return int(input())

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

def mins(x, y):
    x = min(x, y)

def maxs(x, y):
    x = max(x, y)

while(True):
    try:
        n = int(input())
        a = list(map(int, input().split()))
        mx = max(a)
        if (sum(a) - mx) > mx:
            print("Yes")
        else:
            print("No")
    except EOFError:
        exit()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)

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

Submission status: Accepted

Solution code:
n = int(input())
L = [int(i) for i in input().split()]
sumL = sum(L)
maxL = max(L)
print('Yes' if maxL < sumL - maxL else 'No')

Submission status: Accepted

Solution code:
N = int(input())
l_list = list(map(int, input().split()))
l_list.sort(reverse=True)
maxnum = l_list[0]
sum_num = sum(l_list[1:])

if maxnum < sum_num:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
l = list(li())

longest = max(l)
others = sum(l) - longest
print('Yes') if others > longest else print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    num = int(input())
    data = list(map(int, input().split()))
    max_data = max(data)
    if sum(data) - max_data > max_data:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

n = ip()                              #入力整数1つ
#t,x= (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

#jの変数はしようできないので注意

a.sort()
if max(a) < sum(a)-max(a): j(1)
else: j(0)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
L = list(map(int, input().split()))
ans = sum(L) - 2 * max(L)
print(['No', 'Yes'][ans > 0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
#template input
import bisect

def IT(): #整数1個
    return int(input())
def IL(): #整数複数
    return [int(_) for _ in input().split()]
def IS(): #文字列複数
    return [_ for _ in input().split()]
def ILS(n): #整数1つ　縦にズラーってなってるやつ
    return [int(input()) for _ in range(n)]
def SLS(n): #文字列　縦にズラーってなってるやつ
    return [input() for _ in range(n)]
def ILSS(n): #整数複数　縦にズラーってなってるやつ
    return [[int(_) for _ in input().split()] for j in range(n)]

#template technique
def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)
def bit_full_search2(A):
    #https://blog.rossywhite.com/2018/08/06/bit-search/
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                #output.append(A[j])
                output.append(A[j])
        value.append([format(i, 'b').zfill(16), sum(output)])

    value.sort(key=lambda x:x[1])
    bin = [value[k][0] for k in range(len(value))]
    val = [value[k][1] for k in range(len(value))]
    return bin, val
def matching_bisect(list1_val, list2_val, n):
    #2分探索
    j = 0
    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                #ans = list2_bin[j] + list1_bin[i]
                break
    return j

"""ここからメインコード"""
def main():
    n = IT()
    l = IL()
    l.sort()
    l2 = l[-1]
    l.pop()
    if l2 < sum(l):
        print("Yes")
    else:
        print("No")


main()

Submission status: Accepted

Solution code:
n =int(input())
l = list(int(i) for i in input().split())
ans = 'Yes'
judge = sum(l)
for i in range(n):
    if l[i] < judge-l[i]:
        continue
    else:
        ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict, Counter
from bisect import bisect

setrecursionlimit(10**7)

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(m) for m in input().split()]
k = max(a)
q = sum(a) - k
if q > k:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
*L, = map(int, input().split())
S = sum(L)

print("Yes" if all(L[i] < S - L[i] for i in range(N)) else "No")

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int, input().split()))
s.sort()
longest = s[-1]
lsum = sum(s[:-1])
print('Yes' if lsum > longest else 'No')

Submission status: Accepted

Solution code:
n=int(input())
listL=list(map(int, input().split()))
listL.sort()
index=0
sum=0
while index < len(listL)-1:
    sum+=listL[index]
    index+=1
if sum > listL[len(listL)-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
# import bisect
# import math
# import numpy as np


"""Template"""


class IP:
    """
    入力を取得するクラス
    """
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x//y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    n = ip.I()
    l = ip.IL()

    id.S(l, 1)
    o = l[0]
    l.pop(0)
    if o < sum(l):
        print("Yes")
    else:
        print("No")


main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))

a.sort()
a.reverse()

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

Submission status: Accepted

Solution code:
N=int(input())
L=[int(i) for i in input().split(" ")]
L=sorted(L)
if L[-1]<sum(L[:N-1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
n=int(input())
l=sorted(list(map(int,input().split())))
if l[-1]<sum(l[:-1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def read():
    return int(input())


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


def readmap():
    return map(int, input().split())


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

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline())
a = map(int,stdin.readline().split())
ans = 'Yes'
if sum(a) <= 2*max(a):
  ans = 'No'
print ans

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

l = sorted(l)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())
L = list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
def func():
    pass


def main():
    n = int(input())
    l = [int(i) for i in input().split()]
    l.sort()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

s = sum(L[:-1])

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

n = ni()
a = na()

x = max(a)
s = sum(a)
if x < s-x:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
eda=list(map(int,input().split()))
maximum=max(eda)
if maximum<sum(eda)-maximum:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

    L = sorted(L)

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


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

n = getN()
edge = getList()

if sum(edge) > max(edge) * 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(raw_input())
lis = map(int, raw_input().split())
lis = sorted(lis)
summ = sum(lis)
if lis[-1] < summ - lis[-1]:
    print "Yes"
else:
    print "No"

Submission status: Accepted

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

xs = sorted(L)

result = xs[-1] < sum(xs[:-1])

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

Submission status: Accepted

Solution code:
def solve(N, Ls):
    if max(Ls) < sum(Ls) - max(Ls):
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    N = int(input())
    Ls = list(map(int, input().split(" ")))
    print(solve(N, Ls))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L.sort(reverse=True)

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
L = LI()
L.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def  inpl(): return list(map(int, input().split()))
N = int(input())
L = sorted(inpl())
if sum(L[:-1]) > L[-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
X = [int(a) for a in input().split()]

if sum(X) > max(X) * 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

def B():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort()
    cnt = 0
    for i in range(N - 1):
        cnt += L[i]
    if L[-1] < cnt:
        print("Yes")
    else:
        print("No")
B()

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
A = sorted(map(int, raw_input().split()))
S = sum(A)

if A[-1] < S - A[-1]:
    print "Yes"
else:
    print "No"

Submission status: Accepted

Solution code:
N = int(input())
L = sorted([int(_) for _ in input().split()])
if L[N - 1] < sum(L[:N - 1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N=int(input())
L=[int(i) for i in input().split()]
S=sum(L)-max(L)
T=max(L)
if T<S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
l.sort(reverse=True)
if l[0] < sum(l[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a.sort()
l = a.pop()
if sum(a) <= l:
        print("No")
else:
        print("Yes")

Submission status: Accepted

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

L.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

#A
"""
t,x = LI()
print(t/x)
"""

#B
n = II()
a = LI()
m = max(a)
if m >= sum(a)-m:
    print("No")
else:
    print("Yes")
#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

Solution code:
n = int(input())
lll = list(map(int, input().split()))
ml = max(lll)
sl = sum(lll) - ml
if ml >= sl:
    print('No')
else:
    print('Yes')

Submission status: Judge Not Available

Solution code:
a = int(input().strip())
lArray = list(map(int, input().strip().split(' ')))
sum = 0
lArray.sorted(reversed=True)
for i in range(len(lArray) - 1):
    sum = sum + lArray[i+1]
if lArray[0] > sum:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
#ABC117B
n = int(input())
l = [int(input()) for i in range(n)]
print("Yes" if max(l) >= (sum(l)-max(l)) else "No")

Submission status: Runtime Error

Solution code:
#ABC117B
n = int(input())
l = [int(input()) for i in range(n)]
print("Yes" if max(l) >= sum(l)-max(l) else "No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input()))

print(max(l) < sum(l) - max(l))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    l = list(map(int, input().split()))

    max_l = max(l)
    exc_l = l.remove(max_l)

    sum_exc_l = sum(exc_l)

    if max_l < sum_exc_l:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# 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))