fun readStr () = let fun scan reader stream = SOME (StringCvt.splitl (not o Char.isSpace) reader (StringCvt.skipWS reader stream)) in valOf (TextIO.scanStream scan TextIO.stdIn) end val () = let val s = readStr () val ans = if String.sub (s, 0) = String.sub (s, 1) andalso String.sub (s, 0) <> String.sub (s, 2) then "Yes" else "No" in print (ans ^ "\n") end