A four-digit natural number is given. Determine whether it contains exactly three identical digits. That is, three of its digits must be the same, while the other one must be different.
A four-digit natural number.
If the number contains exactly three identical digits, print "YES", otherwise print "NO".
Example 1
Example 2