program ABC088C
    implicit none
    integer(8)::C(3,3),i,j,Csum
    read*,C
    Csum=0
    do i=1,3
        do j=1,3
            Csum=Csum+C(j,i)
        end do
    end do

    if(mod(Csum,3)==0)print'(A)',"Yes"
    if(mod(Csum,3)/=0)print'(A)',"No"
end program ABC088C