main = getLine >>= putStr . solve

solve [x, y, z, w]
  | x == y && y == z = "Yes"
  | y == z && z == w = "Yes"
  | z == w && w == x = "Yes"
  | w == x && x == y = "Yes"
  | otherwise = "No"

  
  
  
