Problem4536--多边形的判定

4536: 多边形的判定

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

给定 lns="http://www.w3.org/1998/Math/MathML">N 条线段的长度,第一条线段长度为 lns="http://www.w3.org/1998/Math/MathML">A1,第二条为 lns="http://www.w3.org/1998/Math/MathML">A2,以此类推。

请判断,能否用这些线段,围成一个封闭的 lns="http://www.w3.org/1998/Math/MathML">N 边形?

一些线段不能围成封闭图形的充分必要条件是存在一条线段,其长度超过或等于剩余线段的长度之和。


提示:这道题的关键在于判断是否能够构成一个多边形。
根据多边形的性质:任意一条边的长度必须严格小于其他所有边的长度之和
如果存在一条边长度大于等于其他边的长度和,那就无法构成封闭图形。

所以我们只需要检查:
最长的一条边是否小于其他边的长度之和。

Input

  • 第一行:单个整数 lns="http://www.w3.org/1998/Math/MathML">N
  • 第二行:lns="http://www.w3.org/1998/Math/MathML">N 个整数 lns="http://www.w3.org/1998/Math/MathML">A1,A2,,AN
  • 对于 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">1N100
  • 对于 lns="http://www.w3.org/1998/Math/MathML">60% 的数据,lns="http://www.w3.org/1998/Math/MathML">1N5,000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1N100,000
  • lns="http://www.w3.org/1998/Math/MathML">1Ai20000



Output

如果可以,输出 Yes,否则输出 No。

Sample Input Copy

6
1 3 5 2 4 6

Sample Output Copy

Yes

Source/Category