[<EntryPoint>]
let main argv =
    let s = stdin.ReadLine()
    let isGoodString s = s |> Seq.distinct |> Seq.length = (s |> String.length)
    if isGoodString s.[0..3] || isGoodString s.[1..4] then "Yes" else "No" |> stdout.WriteLine
    0