A good 4-digit integer is defined as one that contains three or more consecutive identical digits. For example, integers like 1118, 2220, or 4444 are considered good.
You are given a 4-digit integer ( N ). Your task is to determine whether ( N ) is a good integer.
Input Format
A single integer ( N ) (1000 ≤ ( N ) < 10000), representing the 4-digit integer.
Output Format
Print "YES" if ( N ) is a good integer.
Print "NO" if ( N ) is not a good integer.
Examples
Example 1
Input:
text
1118
Output:
text
YES
Example 2
Input:
text
1234
Output:
text
NO
Example 3
Input:
text
4444
Output:
text
YES
Solution
Please place your solution in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.