Given three numbers, check if one of them equals the average of the other two X81984


Statement
 

pdf   zip

html

Write a program that reads three integers and checks if there is one of them which equals the average of the other two.

Input

Three integer numbers in one line.

Output

If one of the three numbers equals the average of the other two, prints YES. Otherwise, prints NO.

Public test cases
  • Input

    1 2 3

    Output

    YES
    
  • Input

    2 1 3

    Output

    YES
    
  • Input

    3 1 2

    Output

    YES
    
  • Input

    1 1 2

    Output

    NO
    
  • Input

    -1 -1 -2

    Output

    NO
    
  • Input

    -1 -2 -3

    Output

    YES
    
  • Input

    -2 -1 -3

    Output

    YES
    
  • Input

    -3 -1 -2

    Output

    YES
    
  • Input

    -10 0 10

    Output

    YES
    
  • Input

    -13 5 -8

    Output

    NO
    
  • Information
    Author
    PRO1
    Language
    English
    Translator
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    C++
    User solutions
    C++ Python