Four-digit number is given. Determine if it contains exactly three identical digits.
One four-digit number n.
Print "YES" if number n contains exactly three identical digits, and "NO" otherwise.