题解 | #木棒拼图#
木棒拼图
https://www.nowcoder.com/practice/8bbc9415216d47459c425b5e19164365
n=int(input())
lst=[]
for _ in range(n):
i,L=list(map(int,input().split()))
if i==1:
lst.append(L)
else:
lst.remove(L)
if len(lst)<3:
print('No')
else:
M=max(lst)
if M>=sum(lst)/2:
print('No') # 两边之和大于第三边才行
else:
print('Yes')

