Equal to the sum of the rest (I) P81585


Statement
 

pdf   zip

html

Write a program that, given a sequence of natural numbers, tells if there is any number equal to the sum of the rest.

Input

Input contains several cases. Each case begins with a number n≥1 followed by n natural numbers.

Output

For each case, tell if it has a number equal to the sum of the rest.

Public test cases
  • Input

    6   1 0 5 3 1 0
    7   1 0 3 3 1 0 2
    2   666 666
    

    Output

    YES
    NO
    YES
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python