import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = 0;
      int x2 = 0;
      int y1 = 0;
      int y2 = 0;
      x1 = a[3] - a[0];
      x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	}
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz