eolymp
bolt
Try our new interface for solving problems
Problems

Three identical digits

Three identical digits

Four-digit number is given. Determine if it contains exactly three identical digits. \InputFile One four-digit number $n$. \OutputFile Print "\textbf{YES}" if number $n$ contains exactly three identical digits, and "\textbf{NO}" otherwise.
Time limit 1 second
Memory limit 128 MiB
Input example #1
2322
Output example #1
YES
Input example #2
2234
Output example #2
NO