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: # -*- coding: utf-8 -*-
  """
  Created on Sun Nov  4 21:46:51 2018
  
  @author: sk
  """
  
  a = str(input())
  
  char_list = list(a)
  
  
  if a(0)==a(1):
    if a(1)==a(2):
      print("Yes")
    elif a(1)==a(3):
      print("Yes")
    else :
      print("No")
  
  elif a(1)==a(2):
    if a(2)=a(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"}]