integer(8) a,b,d,e,f,g,check
integer(8),dimension(3,3):: c
 
check=0
do i=1,3
  read*,c(i,:)
end do

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
          
    else
      check=1
    endif
  else
    check=1
  endif
enddo
 
if (check==0)then
  print"(A)","Yes"
else
  print"(A)","No"
endif
end