Given four integers, check that two of them are equal and the other two are different X29232


Statement
 

pdf   zip

html

Write a program that reads four integers and determines if two of them are equal and the remaining ones are different from any other.

Input

Four integers in one line.

Output

If two integers in the input are equal to each other and the other two are different from any other one then print YES. Otherwise, print NO.

Observation

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

Public test cases
  • Input

    15 -30 2 15

    Output

    YES
    
  • Input

    -333 22 -333 -333

    Output

    NO
    
  • Input

    0 0 0 0

    Output

    NO
    
  • Input

    1 2 4 8

    Output

    NO
    
  • Input

    1 -1 1 -1

    Output

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