Polygon
题号:NC237309
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

You have n segments, which are numbered from 1 to n. The length of the i-th segment is a_i.
A simple polygon is a polygon that does not intersect itself and has no holes. Note that a simple polygon has at least 3 edges and its area is not equal to 0.
Determine whether you can use all n segments to form a simple polygon with n edges. Note that each segment must be used exactly once.

输入描述:

The first line contains one single integer  (), denoting the number of segments.

The second line contains  integers  (), denoting the length of the -th segment.

It is guaranteed that .

输出描述:

If you can use these  segments to form a simple polygon, output YES, otherwise NO.
示例1

输入

复制
3
3 4 5

输出

复制
YES

说明

In the first example, you can use them to construct a right-angled triangle
示例2

输入

复制
4
1 1 1 3

输出

复制
NO