implicit none
integer(8):: a,b,d,e,f,g,check,i
!integer(8),dimension(3):: c1, c2, c3
integer(8),dimension(3,3):: c

check=0

read(5,*) (c(1,i),i=1,3)
read(5,*) (c(2,i),i=1,3)
read(5,*) (c(3,i),i=1,3)

a=c(1,1)-c(1,2)
b=c(1,2)-c(1,3)
d=c(1,3)-c(1,1)
e=c(1,1)-c(2,1)
f=c(2,1)-c(3,1)
g=c(3,1)-c(1,1)

do i=1,3
    if (c(i,1)-c(i,2)==a .and. c(i,2)-c(i,3)==b .and. c(i,3)-c(i,1)==d) then
        if (c(1,i)-c(2,i)==e .and. c(2,i)-c(3,i)==f .and. c(3,i)-c(1,i)==g) then
            continue
        else
            check=1
        endif
    else
        check=1
    endif
enddo

if (check==0)then
    write(6,*) "Yes"
else
    write(6,*) "No"
endif

end