Given four integers, two of them add up to the same as the other two X68995


Statement
 

pdf   zip

html

Write a program that reads four integers and determines if the sum of two of them equals the sum of the other two.

Input

Four integers in a line.

Output

If two integers of the four add up to the same sum as the other two, the output will be YES followed by a newline character. Otherwise the output is NO followed by a newline character.

Observation

You cannot use massive storage data structures, such as string or vector.

Public test cases
  • Input

    1 2 3 4
    

    Output

    YES
    
  • Input

    -1 -2 -3 -4

    Output

    YES
    
  • Input

    8 7 1 6

    Output

    NO
    
  • Input

    7 8 7 7

    Output

    NO
    
  • Input

    2 8 1 9

    Output

    YES
    
  • Input

    1 6 9 4

    Output

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