e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Two identical digits

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.

Input

One four-digit number.

Output

Print "YES" if the number satisfies the specified condition, and "NO" otherwise.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2323
Output example #1
YES
Input example #2
2224
Output example #2
NO