    let input = stdin.ReadLine().ToCharArray()
    let intAry = input |> Array.map string |> Array.map int

    let sum = Array.sum intAry    

    if sum % 9 = 0 then printfn "Yes" else printfn "No" 