Problem K. 25. Prefix-Suffix pairs
Input file name: standard input
Output file name: standard output
Time limit: 1 s
Memory limit: 1024 MB
Given an array A of N integers, find if there exists an index i and j (1 \le i, j \le N) such that the sum of the first i elements (prefix) is equal to the sum of the last j elements (suffix). Note: The prefix and suffix can't overlap.

Input

The first line contains an integer N (1 \le N \le 10^5). The second line contains N integers A_1, A_2, \dots, A_N (|A_i| \le 10^9).

Output

Print "YES" if such a prefix and suffix exist, and "NO" otherwise.

Examples

standard inputstandard output
4 1 2 3 3 YES
3 1 2 4 NO