Competitions
Week 2 Conditionals Part 2
Three identical digits
Four-digit number is given. Determine if it contains exactly three identical digits.
Input data
One four-digit number n.
Output data
Print "YES" if number n contains exactly three identical digits, and "NO" otherwise.
Examples
Input example #1
2322
Output example #1
YES
Input example #2
2234
Output example #2
NO