Week 2: November 16 – 22. Conditional statement. Part 2
Two identical digits
Four-digit number is given. Determine whether it contains exactly two different digits, each of these digits must occur twice. For example, the numbers 2727 and 6677 satisfy this condition.
One four-digit number.
Print "YES" if the number satisfies the specified condition, and "NO" otherwise.