Two identical digits
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Four-digit number is given. Determine whether it contains exactly two different digits, each of these digits must occur twice. For example, the numbers and satisfy this condition.
Input
One four-digit number.
Output
Print "YES" if the number satisfies the specified condition, and "NO" otherwise.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 16K
Acceptance rate 30%