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 = input()
L = list(map(int, input().split()))
L.sort(reverse=True)
maxL = L[0]
sumL = sum(L[1:])
if maxL < sumL:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

s = sum(lis)
m = max(lis)

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

Submission status: Accepted

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

l.sort()
l.reverse()

maxLen = l[0]
otherLen = 0

for i in range(len(l)):
    if not i == 0:
        otherLen += l[i]

# print(maxLen)
#print(otherLen)

if maxLen < otherLen:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
### B

N = int(input())

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

length = 0

M = max(L)

for l in L:
	length += l

if length - 2*M > 0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n, l):
    m = max(l)
    l.remove(m)
    t = sum(l)
    if t > m:
        print("Yes")
    else:
        print("No")

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

main()

Submission status: Accepted

Solution code:
n = int(input())
l = input().split()
max = 0
sum = 0
for i in range(n):
    l[i] = int(l[i])
    sum += l[i]
    if max <= l[i]:
        max = l[i]


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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L_max = max(L)
    L_sum = 0
    L_sum -= L_max
    for l in L:
        L_sum += l
    if L_max < L_sum:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

m = max(l)
l.remove(m)

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

Submission status: Accepted

Solution code:
n=int(input())
ans=True
l=[int(i) for i in input().split()]
maxnum=max(l)
l.remove(maxnum)
sum=0
for i in l:
    sum+=i
if sum>maxnum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

max_num = max(l)
sum_num = sum(l) - max_num

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
lst = list(map(int,input().split()))
lst.sort(reverse = True)
count = 0
longest = 0
for n,i in enumerate(lst):
    if n == 0:
        longest = i
    else:
        count += i

if longest < count:
    print("Yes")
else:
    print("No")
#print(longest,count)

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in input().split(" ")]
L.sort()
L_max = L[-1]
L_sum = sum(L[0:N-1])
if L_max < L_sum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = input().split()
L = [int(i) for i in L]
L = sorted(L, reverse=True)
hen = 0

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

Submission status: Accepted

Solution code:
N = int(input())
L_n = list(map(lambda x: int(x),input().split()))

max_num = max(L_n)
L_n.remove(max_num)

if max_num < sum(L_n):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
def db(x): 
    global debug
    if debug: print(x)
debug = False
N = getInt()
L = getIntList()
L.sort()
L.reverse()
db((N,L))
sm = 0
for i in range(1,N):
    sm += L[i]
db(sm)
if L[0]<sm: print('Yes')
else: print('No')

Submission status: Accepted

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

maxL = max(L)
maxIndex = L.index(maxL)
L.pop(maxIndex)
total = 0
for l in L:
    total += l

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

Submission status: Accepted

Solution code:
N = int(input())

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

lmax = max(L)
L.remove(lmax)
lsum = sum(L)

if lmax < lsum:
    print('Yes')
elif lmax >= lsum:
    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())
A = li = list(map(int,input().split()))
A.sort()

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

Solution code:
n = int(input())

l = [int(i) for i in input().split()]
m = max(l)
l.pop(l.index(m))

total = sum(l)

if total > m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in input().split()]
L.sort(reverse=True)
ans = sum(L[1:])

if L[0] < ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Llist = [int(x) for x in input().split()]
sortedList = sorted(Llist, reverse=True)
sumL = 0
for i,x in enumerate(sortedList):
    if i == 0:
        continue
    sumL = sumL + x
if sortedList[0] < sumL:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = input()
edges = [int(i) for i in input().split()]
max_edge = max(edges)
edges.remove(max_edge)

if max_edge < sum(edges):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter


def r(n, l):
    l.sort(reverse=True)
    lm = l[0]
    ln = sum(l[1:])
    return 'Yes' if lm < ln else 'No'


def main():
    input = sys.stdin.readline
    n = int(input())
    l = list(map(int, input().split()))

    print(r(n, l))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# encoding:utf-8

import copy
import numpy as np
import random

n = int(input())

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

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

answer = "Yes"
for i in range(n):
    if l[i] < sum_all-l[i]:
        pass
    else:
        answer = "No"

print(answer)

Submission status: Accepted

Solution code:
import sys

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


longest_index = l_list.index(max(l_list))
other_sum = 0

for i in range(n):
    if i == longest_index:
        continue
    else:
        other_sum += l_list[i]

if l_list[longest_index] < other_sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
x=input().split()
y=[int(i) for i in x]
y.sort()
S=0
for i in y:
    S+=i
S-=y[N-1]
if(S<=y[N-1]):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
num = int(input())
lens = [int(a) for a in input().split(' ')]
max_len = max(lens)
lens.remove(max_len)
sum_lens = sum(lens)
 
if max_len < sum_lens:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
l = list(map(int, input().split()))
m = max(l)
othersum = sum(l) - m
if m < othersum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
dmax=max(data)
data.remove(dmax)
dsum=sum(data)
if dsum>dmax:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())
l = [int(n) for n in input().split(" ")]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

b = sorted(a)

mx = b[-1]
cnt = 0
for i in range(len(b) - 1):
    cnt += b[i]
print("Yes" if cnt > mx else "No")

Submission status: Accepted

Solution code:
B=int(input())
A=list(map(int,input().split(" ")))
m=max(A)
A.remove(m)
if sum(A)>m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

def compare(a1, a2):
    if a1 < a2:
        return True
    else:
        return False

if compare(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()))

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

Submission status: Accepted

Solution code:
N = int(raw_input())
L = sorted(map(int, raw_input().split()))
Lmax = L[-1]
Lsum = sum(L[:-1])
if Lmax < Lsum:
  print "Yes"
else:
  print "No"

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
m = max(L)
s = 0
i = True
for j in L:
    if m == j and i:
        i = False        
        continue
    s += j

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n =int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
sum = 0
for i in range(1,n):
    sum += l[i]
if l[0] < sum:
    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[-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

_ = input()
ls = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
from sys import stdin

n = stdin.readline().rstrip()
l = list(map(lambda x: int(x), stdin.readline().rstrip().split(" ")))

sum = 0
for li in l:
    sum += li

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

Submission status: Accepted

Solution code:


n = int(input())

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


li.sort()

sum_ = sum( li[i] for i in range( len(li)-1 ) )

print( 'Yes' if sum_ > li[n-1] else 'No' )

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(map(int, input().split()))
tmp = 0
las = 0
for i in L:
    tmp += i
    las = i
print("Yes" if las < tmp - las else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
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()
s = sum(L[:-1])
if L[n-1] < s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
len_list = [int(each) for each in input().split()]
len_list.sort()
max_side = len_list[N-1]
sum_o = 0.0
for i in range(N-1):
    sum_o += len_list[i]
if(sum_o > max_side):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding:utf-8

N = int(input())

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

L.sort()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n = int(input())
    ls = list(map(int, input().split()))

    max_val = max(ls)
    flag = 0
    total = 0
    for i in range(n):
        if ls[i] == max_val:
            if flag == 0:
                flag = 1
                pass
            else:
                total += ls[i]
        else:
            total += ls[i]

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/02/03
# AtCoder Beginner Contest117 - B

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

# Choose Max
max = 0

for i in range(n):
    if l[i] > max:
        max = l[i]
        max_idx = i

# Sum
sum = 0
for j in range(n):
    if j != max_idx:
        sum += l[j]

if sum > max:
    ans = "Yes"
else:
    ans = "No"

# Output
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
t = 0
for l in L :
    t += l
t = t - max(L)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
""" AtCoder """

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

L.sort()

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

Submission status: Accepted

Solution code:
N = int(input())
L_list = list(map(int, input().split())) # "1 2 3"と入力

l_max=max(L_list)
total_l=sum(L_list)-l_max

if l_max<total_l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l.sort()
maxl = l.pop(-1)
totalr = sum(l)
if maxl < totalr:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input().split()
L = [int(s) for s in S]
L.sort(reverse=True)
if L[0] < sum(L[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


for i in range(len(L)):
    L[i] = int(L[i])

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()))

su = sum(L)
ma = max(L)

if su - ma > ma:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
from operator import itemgetter

# N, K = map(int, input().split())
# h = list(map(int, input().split()))
# S = [input() for _ in range(H)]
# X = [[0 for j in range(100)] for i in range(200)]


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

## solve
sum = 0
for i in L:
	sum += i
	
ans = "Yes"
if (max(L) >= sum - max(L)):
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
def main(L):
    S = sum(L)
    for l in L:
        if S - l <= l:
            print("No")
            return None
    print("Yes")
    
N = int(input())
L = list(map(int, input().split()))
main(L)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(_) for _ in input().split()]

mp = max(p)
print('Yes' if mp < sum(p) - mp else 'No')

Submission status: Accepted

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

t = sum(L)
L_max = max(L)

if L_max < t-L_max:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

L.sort()
L.reverse()

subsum = 0
for i, l in enumerate(L):
	if i == 0:
		l_max = l
	else:
		subsum += l

if l_max < subsum:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 27 20:47:58 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
    
all(nstr.count(c) for c in '753')

ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
#A, B, totAB = zip(*ABT)

"""

N = int(input())

L = [0]*N
L[:] = map(int, input().split())


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

Submission status: Accepted

Solution code:
n = int(input())

l = [int(x) for x in input().split()]

m = max(l)
s = sum(l) - m

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

Submission status: Accepted

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

Submission status: Accepted

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

top = max(lines)
border = sum(lines) - top

if top < border:
	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) - m
if m < s:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n=int(input())
l=list(map(int,input().split()))
lm=max(l)
l.remove(lm)
if lm<sum(l):
    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 * 2 < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N= int(input())
aL = [int(_) for _ in input().split()]
iL = sum(aL)
for i in range(N):
    if  iL - aL[i] <= aL[i]:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

a = list[0]
del list[0]

print("Yes" if sum(list) > a else "No")

Submission status: Accepted

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

mx = max(le)
import numpy as np

le.remove(mx)
sumle = np.sum(le)

if (mx<sumle):
    print("Yes")

if (mx>=sumle):
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
n=int(input())
x=[int(i) for i in input().split()]
x.sort()
sum=0
for i in range(n-1):
    sum+=x[i]
print("Yes"if x[-1]<sum else "No" )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log, pi, e, asin,acos, cos, sin, floor, atan
from itertools import *
from fractions import Fraction
import string
import copy
import random
import bisect
from decimal import *
from collections import deque
from sys import *
digs = string.digits + string.ascii_letters

def id_generator(size=20, chars=string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
    return map(int,str(raw_input()).strip().split())

clear=stdout.flush()

n=input()
l=list(mp())
l.sort()
z=sum(l[:n-1])
if z>l[-1]:
	print "Yes"
else:
	print "No"

Submission status: Accepted

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

maxi = max(L)

sum_ = sum(L)-maxi

if maxi < sum_:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

m = l.pop(l.index(max(l)))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

list.sort(reverse=True)
max = list[0]
sum = sum(list[1:])
if max < sum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest 117：B - Polygon


def main():
    N = int(raw_input().strip())
    L = [int(i) for i in raw_input().strip().split(' ')]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
li=list(input().split())
li=[int(s)for s in li]
li=sorted(li)
maxi=max(li)
del li [-1]
if sum(li)>maxi:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

ans='Yes'
if (max(L)-(sum(L)-max(L)))>=0:
    ans='No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

l_max = max(L)

cond = "Yes" if (l_max < (sum(L)-l_max)) else "No"
print(cond)

Submission status: Accepted

Solution code:
N = int(input())
L = [int(_) for _ in input().split()]
L.sort(reverse = True)
if L[0] < sum(L) - L[0]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from functools import reduce
from operator import add

def solve():
  N = int(input())
  L = [int(i) for i in input().split()]
  return 'Yes' if reduce(add, L) > max(L) * 2 else 'No'

print(solve())

Submission status: Accepted

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

max_L = max(Ls)
idx = Ls.index(max_L)

total = 0
for i in range(len(Ls)):
    if i != idx:
        total += Ls[i]

if total > max_L:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import copy
n = int(input())
l_arr = [int(i) for i in input().split()]

oth_arr = copy.deepcopy(l_arr)
oth_arr.remove(max(oth_arr))

if sum(oth_arr) > max(l_arr):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

longest = l.pop(l.index(max(l)))
if longest < sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
lst = list(map(int, input().split()))
L_max = max(lst)
lst.remove(L_max)

if L_max < sum(lst):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

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

for i in range(n):
    sum = 0
    for j in range(n):
        if (i != j):
            sum += l[j]
    if not (sum > l[i]):
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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



for i in range(N):
    if(L[i] >= sum(L)-L[i]):
        ans = False

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

Submission status: Accepted

Solution code:
#A

#B
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = sum(l) - 2*l[-1]
if ans > 0:
    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())
l.sort()
print("Yes" if l[-1] < sum(l[:n-1]) else "No")

Submission status: Accepted

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

L.sort()
m = L[-1]
other = L[0:N-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  3 21:03:02 2019

@author: Yamazaki Kenichi
"""

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in L:
  if sum(L) - i <= i:
    print("No")
    exit()
else:
  print("Yes")

Submission status: Accepted

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

L_list.sort()
maxL = L_list[-1]

if maxL < (sum(L_list)-maxL):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
l=list(map(int,input().split()))
ml=l.pop(np.argmax(l))
if ml < sum(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

maxL = max(L)
sumL = sum(L)
if sumL - maxL > maxL:
    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("Yes")
else:
    print("No")

Submission status: Accepted

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

L = sorted(L,reverse=True)
L_max = L[0]
L_sum = sum(L[1:])

if L_max < L_sum:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = input().split(" ")
L = [int(i) for i in L]
L = sorted(L)
mx = max(L)
total = 0
for i in range(N-1):
    total += L[i]
if mx < total:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc117/tasks/abc117_b

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

l_sum = sum(L[:len(L)-1])
longest = L[len(L)-1]

if l_sum > longest:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

b = sorted(b,reverse=True)

if b[0] < sum(b[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

maxL = max(L)

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

Submission status: Accepted

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

max = -1
total = 0
for l in L:
  total += l
  if max < l:
    max = l
    
if total - max > max:
  print("Yes")
else:
  print("No")