P23786 [AtCoder] Good Integer
入门
题目描述

Problem Statement

We call a 4-digit integer with three or more consecutive same digits, such as 1118, good.
You are given a 4-digit integer N. Answer the question: Is N good?

Input

Input is given from Standard Input in the following format:
N

Output

If N is good, print Yes; otherwise, print No.

Constraints

  • 1000 ≤ N ≤ 9999
  • N is an integer.

Sample Input 1

1118

Sample Output 1

Yes

N is good, since it contains three consecutive 1.

Sample Input 2

7777

Sample Output 2

Yes

An integer is also good when all the digits are the same.

Sample Input 3

1234

Sample Output 3

No

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1118
样例输出
Yes