output_description: If N is **good** , print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: import math
  import sys
  import itertools
  import queue
  from fractions import gcd
  
  
  def lcm(a, b):
      return a * b // gcd(a, b)
  
  
  def combination(n, r):
      return factorial(n) // (factorial(n - r) * factorial(r))
  
  
  sys.setrecursionlimit(10000)
  
  mod = 1000000007
  
  """
  # 0埋め, 小数点出力桁指定時のときの出力
  a = 100
  b = 0.987654321
  print("{0:06d}-{1:6f}".format(a,b))
  000100-0.987654
  
  # 文字列をリストに格納
  char_list = list("abcd") # ["a","b","c","d"]
  
  # 標準入力取得
  ## 文字列
      = sys.stdin.readline().rstrip()
      = list(sys.stdin.readline().rstrip())
  
  ## 数値
      = int(sys.stdin.readline())
      = map(int, sys.stdin.readline().split())
      = list(map(int, sys.stdin.readline().split()))
      = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
  """
  
  if __name__ == "__main__":
      N = list(sys.stdin.readline().rstrip())
      if N[:3].count(N[0]) == 3 or N[1:].count(N[1]) == 3:
          print("Yes")
      else:
          print("No")
  
problem_description: 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**?
samples: [{"input": "1118", "output": "Yes\n    \n\nN is **good** , since it contains three consecutive 1.\n\n* * *"}, {"input": "7777", "output": "Yes\n    \n\nAn integer is also **good** when all the digits are the same.\n\n* * *"}, {"input": "1234", "output": "No"}]