Three identical digits#377

Three identical digits

1 second
128 megabytes
Very easy (≈850)

A four-digit natural number is given. Determine whether it contains exactly three identical digits. That is, three of its digits must be the same, while the other one must be different.

Input

A four-digit natural number.

Output

If the number contains exactly three identical digits, print "YES", otherwise print "NO".

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading