A - Good Integer Editorial /

Time Limit: 2 sec / Memory Limit: 256 MB

配点 : 100

問題文

1118 のような、3 つ以上の同じ数字が連続して並んだ 4 桁の整数を 良い整数 とします。

4 桁の整数 N が与えられるので、N良い整数 かどうかを答えてください。

制約

  • 1000≦N≦9999
  • 入力は整数からなる

入力

入力は以下の形式で標準入力から与えられる。

N

出力

N良い整数 ならば Yes を、そうでなければ No を出力せよ。


入力例 1

1118

出力例 1

Yes

13 つ連続して並んでいるので 良い整数 です。


入力例 2

7777

出力例 2

Yes

全ての数字が同じ場合も 良い整数 になります。


入力例 3

1234

出力例 3

No

Score : 100 points

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?

Constraints

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

Input

Input is given from Standard Input in the following format:

N

Output

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


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