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

Three identical digits

Three identical digits

Four-digit number is given. Determine if it contains exactly three identical digits.

Input

One four-digit number.

Output

Print "YES" if number contains exactly three identical digits, and "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