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: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
n,l=map(int,open(0).read().split())
sum_n=sum(l)
for i in range(n):
	if 2*l[i]>=sum_n
		print('No')
		import sys
		sys.exit()
print('Yes')

Submission status: Runtime Error

Solution code:
n,l=map(int,open(0).read().split())
sum_n=sum(l)
for i in range(n):
  if 2*l[i]>=sum_n
  	print('No')
    import sys
    sys.exit()
print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(N):
  L[i] = int(L[i])
  total += L[i]

for i in range(N):
  if L[i]*2 >= total:
    print("No")
    flag = 1
    break

if flag == 0:
  print("Yes")

Submission status: Runtime Error

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

for i in range(N):
  total += L[i]

for i in range(N):
  if L[i]*2 >= total:
    print("No")
    flag = 1
    break

if flag == 0:
  print("Yes")

Submission status: Runtime Error

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

for i in range(N):
  total += L[i]

for i in range(N):
  if A[i]*2 >= total:
    print("No")
    flag = 1
    break

if flag == 0:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

l.sort()
l.reverse()
cnt = 0
for i in range(n-1):
	cnt += l[i]
if cnt > l[n]:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:

n = raw_input()
ais = map(int, raw_input())
print 'Yes' if sum(ais)>2*max(ais) else 'No'

Submission status: Runtime Error

Solution code:
_,l=map(int,open(0).read().split())
l.sort()
print("YNeos"[sum(l[:-1])<=l[-1]::2])

Submission status: Runtime Error

Solution code:
_,l=map(int,open(0).read().split())
l.sort()
print("YNeos"[::sum(l[:-1])<=l[-1]])

Submission status: Runtime Error

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

nl = sorted(l)

for i in range(n-1):
	other = 0 + n1[i]

if other < nl[n-1]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
_ = input()
edges = list(int, input().split())
max_edge = max(edges)
print('Yes' if max_edge < sum(edges) - max_edge else 'No')

Submission status: Runtime Error

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

# print(n)
# print(l)

l_s = sorted(l, reverse=True)

# print(l_s)

longest = l_s.pop(0)

# print(longest)
# print(l_s)

if longest < sum(l_s):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()))
tot = sum(l)
flag = True:
for l_i in l:
  if 2 * l_i >= tot:
    flag = False
    break
if flag:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
A = []
for i in range(M-1):
    A.append(X[i+1]-X[i])
A.sort()
print(sum(A[:M-N]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

m = L.pop(max(L))
if sum(L) > m:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N = input()
L = [int(input()) for i in range(N)]
print("Yes" if sum(L) > 2*max(L) else "No")

Submission status: Runtime Error

Solution code:
N = int(input())
L = [int(input()) for i in range(N)]
print('Yes' if sum(L)-max(L) > max(L) and sum(L) -max(L) == max(L) + 1 else 'No')

Submission status: Runtime Error

Solution code:
N = int(input())
L = [int(input()) for i in range(N)]
print('Yes' if sum(L)-max(L) > max(L) else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = map(int,input().split())
max = 0
count = 0

for i in range(N):
  count += L[i]
  if max < L[i]:
    max = L[i]
    
if count < 2*max:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N = input()
L = map(int, input().split())
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
ysum = sum(y)
print("Yes" if Lmax < ysum else "No")

Submission status: Runtime Error

Solution code:
N = int(input())
L = map(int, input().split())
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
ysum = sum(y)
print("Yes" if Lmax < ysum else "No")

Submission status: Runtime Error

Solution code:
N = int(input())
L = map(int, input().split())
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
z = 0
for i in range(N-1):
    z = z + y[i]
print("Yes" if Lmax < z else "No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = int(input())

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

if s_l[0] < s_l[1] + s_l[2] + s_l[3]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

l.sort()

ans = 0
for i+1 in l:
	ans += l[i+1]
    
if l[0] < ans:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

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

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

n = input()
l = list(int, input().split())
s = sum(l)
print('Yes' if n < s else 'No')

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

n = input()
s = sum(int, input().split())

print('Yes' if n < s else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes") return
def No(): print("No") return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
l = inputIL()
l.sort()
if sum(l[:-1]) >= sum[l]:
  No()
else:
  Yes()

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes")
def No(): print("No")

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
l = inputIL()
l.sort()
if sum(l[:-1]) >= sum[l]:
  No()
else:
  Yes()

Submission status: Runtime Error

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

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

if a>=B:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input().split()))
maxL = max(L)
L.pop(maxL)
if maxL > sum(L):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:

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

print("Yes" if max(a) ＜ sum(a)-max(a) else "No")

Submission status: Runtime Error

Solution code:

N = int(input())
a = [int(input()) for i in range(N)]

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

Submission status: Runtime Error

Solution code:
n = int(input())
L = [input() for i in range(n)]
kekka = 0
for i in range(n):
  if 2*L[i] > sum(L):
    kekka = 1
    break
    
if kekka == 1:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=int(input())
L=list(map(int,input().sprit()))
print("Yes" if sum(L)>max(L)*2 else "No")

Submission status: Runtime Error

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

li.sort()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

sum = 0

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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 = [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=input()
l=list(map(int, s.split()))
if max(l)<(sum(l)-max(l)):
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

s = sorted(s, reverse=True)
print("Yes" if s[0] < sum(s[1:]) else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include <vector>
#include <numeric>
using namespace std;

int main(){
    int n;
    int max_s=0;
    int sum_s=0;
    int L;

    cin>>n;
    for (int i=0;i<n;i++){
        cin>>L;
        sum_s+=L;
        max_s=max(max_s,L);
    }  	
	if (max_s<sum_s-max_s){
    cout<<"Yes"<<endl;
    }else{
    cout<<"No"<<endl;
    }
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
num = input()
li = input().split(" ")
a = []
for i in li:
    a.append(int(i))
a.sort()
m = a.pop(0)
b = 0
for i in a:
    b += i
if a < b:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(e) for e in input().split()]

ans ='Yes' if max(a)>= sum([e for e in a]-max(a)) else 'No'
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(e) for e in input().split()]

print('Yes' if max(a)>= sum([e for e in a]-max(a)) else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l.sort(reverse=True)

max = l[0]
els = sum(l[1:])

if max > else:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input(.split())))
ind = L.index(max(L))
if sum(L[ind-1:])+sum(L[:ind+1]) < max(L)
    print('Yes')
else:      
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2 or li[:] < 1:
    print("No")
elif Nmax < sum and 0 < Nmax:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input_angle = int(input())
input_length = input()

_length = input_length.split(' ')
length = [int(l) for l in _length]
length.sort()
sum = 0

for i in range(input_angle-1):
  sum += int(length[i])
  
if int(length[-1]) < sum:
  print('Yes')
else:

Submission status: Runtime Error

Solution code:
input_angle = int(input())
input_length = input()

_length = input_length.split(' ')
length = [int(l) for l in _length]
length.sort()
sum = 0

for i in range(input_angle-2):
  sum += int(length[i])
  
if int(length[-1]) < sum:
  print('Yes')
else:

Submission status: Runtime Error

Solution code:
input_angle = int(input())
input_length = int(input())

length = input_length.split(' ')
length.sort()
sum = 0

for i in range(input_angle-1):
  sum += length[i]
  
if sum > length[-1]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()) for _ in range(n))

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
li_L = map(int, input().split())
a = max(li_L)
li_L = li_L.remove(a)
if a < sum(li_L):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int , [input() for i in range(n)]))
l_max = max(l)
if (sum(l) - l_max) > 0:
  print('Yes')
else :
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
l = [int.input() for i in range(n)]
s = sorted(l)
sum_of_s = sum(s)
if sum_of_s > 2 * s[-1]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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


L_max = max(L)

L_Down = L.sort(reverse=True)

L_Down_Re = L.Down[1:len(L_Down)]

L_Down_Re_Sum =  sum(L_Down_Re)

if L_max <= L_Down_Re_Sum:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
N = int(input())
Larray = list(map(int,input().split()))
lmax = max(Larray)
Larray.remove(lmax)
ltot = 0
for i in range(Larray):
  ltot += i
if lmax > ltot:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))
L_copy = L.copy()
max = max(L)
L_copy.pop(L.index(min))

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

Submission status: Runtime Error

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

s_L = list(sorted(s_L,reverse=True))
if s_L[0] < sum(s_L[1:]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

s_L = sorted(s_L,reverse=True)
if s_L[0] < sum(s_L[1:]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

truth = True
for i in range(len(lengths)):
	curr = lengths[:i]+lengths[i+1:]
	if curr < lengths[i]:
		truth = False
		break
	
print(["No","Yes"][truth])

Submission status: Runtime Error

Solution code:
n = int(input())
sides = []
for i in range(n):
  sides.append(int(input()))
maxim = max(sides)
if maxim>sum(sides)-maxim:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
corners = input()
sides = list(map(int, input().split))
sides = sorted(sides)
for i in (corners-1):
    nums += sides[i+1]
if nums > sides[0]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import functools

n = input()
l = input().split()

if n < 3 or 10 < n:
  return 'No'

for _l in l:
	if _l < 1 or 100 < _l:
		return 'No'

longest = functools.reduce(lambda x,y: x if x > y else y, l)
sum = functools.reduce(lambda x,y: x + y, l) - longest

if longest > sum:
	return 'Yes'
else
	return 'No'

Submission status: Runtime Error

Solution code:
N,L = map(int,open(0).read().split())
L.sort()
if sum(L[::-2]) < L[-1]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

Solution code:
n=input()
int(n)
all=0
a=[]
a=input().split()
mx=0
for i in range(0,n):
	x=int(a[i])
	if x>mx: mx=x
	all=all+x
if all>2*mx : print("Yes")
else : print("No")

Submission status: Runtime Error

Solution code:
n=input()
int(n)
all=0
a=[]
a=input().split()

for i in range(0,n):
	x=int(a[i])
	if x>mx: mx=x
	all=all+x
if all>2*mx : print("Yes")
else : print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n= int(input())
list = [int(x) for x in input().split()]

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

Submission status: Runtime Error

Solution code:
10
1 8 10 5 8 12 34 100 11 3

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input().split()))
for i in range(N):
  if sum(L) - L(i) <= L(i):
    print('No')
    exit()
print('Yes')

Submission status: Runtime Error

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

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

print(L)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
lst = input().split(" ")
list(map(int, lst))
max  = max(lst)
sum = sum(lst)
if sum - max < max:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
N = input()
lst = input().split(" ")
max  = max(lst)
sum = sum(lst)
if sum - max < max:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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


longest = max(x)
x.remove(longest)

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

Submission status: Runtime Error

Solution code:
import sys

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

lengths = sorted(lengths)
max = length.pop(-1)
if max < sum(length) :
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Su1 = sum(L)

hikaku = Su1 - Ma1

if hikaku > ma1:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int,input().split()))
sortl = sorted(l)
ans = 0
for number in sortl:
         ans += number
if ans - sortl(n-1) >= sortl(n-1):
         print("No")
else:
         print("Yes")

Submission status: Runtime Error

Solution code:
x = input().split()
#x = "3 5 0 4 3 6 2 7 2 5 3 3 4 0 5 3 7 5 3 7 2 7 5 7 0 7 2 9 3 2 9 1 3 6 2 0 2 4 6 4 2 3 3 5 7 4 0 6 9 7 6 7 9 8 5 2 2 0 4 7 6 5 5 4 6 3 2 3 0 5 4 3 3 6 2 3 4 2 4 0 8 9 4 6 5 4 3 5 3 2 0 8 2 1 3 4 5 7 8 6 4 0 3 5 2 6 1 2 5 3 2 1 6 9 2 5 6".split()
#x = "2 4 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 2 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 2 9 9 9 0 9 9 2 9 9 9 9 9 9 9 0 -1 -1 -1 -1 8 1 1 8".split()
h = int(x[0])
w = int(x[1])
d = []
for i in range(10):
    d.append(
        list(map(int, x[2 + i * 10 : 2 + i * 10 + 10]))
    )
a = []
for i in range(h):
    a.append(
        list(map(int, x[102 + i * w: 102 + i * w + w]))
    )
#d = [[0] * 10] * 10
for k in range(10):
    for i in range(10):
        for j in range(10):
            if d[i][j] > d[i][k] + d[k][j]:
                d[i][j] = d[i][k] + d[k][j]

#for k in range(0, 10):
#    print(c[k])
#for k in range(0, 10):
#    print(d[k])
#print(d[8][1])

ans = 0
for i in range(h):
    for j in range(w):
        if a[i][j] != 1 or a[i][j] != -1:
            ans += d[a[i][j]][1]
print(ans)

Submission status: Runtime Error

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

L.sort(reverse=True)
max_num = L.pop(0)

if max_num < total(L):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

L.sort(reverse=True)
max_num = L.pop(0)

if max_num < total(L):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
l = list()

for i in range(N):
  n = int(input())
  l.append(n)
  
m = max(l)
SUM = sum(l) - m
 
if m < SUM:
  print('Yes')
else:
  print('No')