import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  }

} Main public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  } main {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  } BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1); r new BufferedReader(new InputStreamReader(System.in), 1) String s; s String sl[]; sl int c[][] = new int[3][3]; c new int[3][3] 3 3 for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    } {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    } sl = r.readLine().split(" ") sl r.readLine().split(" ") r.readLine().split r.readLine() r.readLine r " " for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
        c[i][j] = Integer.parseInt(sl[j]);
      } {
        c[i][j] = Integer.parseInt(sl[j]);
      } c[i][j] = Integer.parseInt(sl[j]) c[i][j] c[i] c i j Integer.parseInt(sl[j]) Integer.parseInt Integer sl[j] sl j int a[] = new int[3]; a new int[3] 3 int b[] = new int[3]; b new int[3] 3 boolean f = true; f true for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    } {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    } int z = c[i][0] - c[i + 1][0]; z c[i][0] - c[i + 1][0] c[i][0] c[i] c i 0 c[i + 1][0] c[i + 1] c i + 1 i 1 0 for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      } {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      } if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        } c[i][j] - c[i + 1][j] != z c[i][j] - c[i + 1][j] c[i][j] c[i] c i j c[i + 1][j] c[i + 1] c i + 1 i 1 j z {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        } f = false f false for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    } {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    } int z = c[0][i] - c[0][i + 1]; z c[0][i] - c[0][i + 1] c[0][i] c[0] c 0 i c[0][i + 1] c[0] c 0 i + 1 i 1 for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      } {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      } if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        } c[j][i] - c[j][i + 1] != z c[j][i] - c[j][i + 1] c[j][i] c[j] c j i c[j][i + 1] c[j] c j i + 1 i 1 z {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        } f = false f false System.out.println(f ? "Yes" : "No") System.out.println System.out System System.out f ? "Yes" : "No" f "Yes" "No" String[] args args public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  }

} public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];

    int c[][] = new int[3][3];

    for(int i = 0; i < 3; i++)
    {
      sl = r.readLine().split(" ");
      for(int j = 0; j < 3; j++)
      {
        c[i][j] = Integer.parseInt(sl[j]);
      }
    }

    int a[] = new int[3];
    int b[] = new int[3];

    boolean f = true;

    for(int i = 0; i < 2; i++)
    {
      int z = c[i][0] - c[i + 1][0];
      for(int j = 0; j < 3; j++)
      {
        if(c[i][j] - c[i + 1][j] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    for(int i = 0; i < 2; i++)
    {
      int z = c[0][i] - c[0][i + 1];
      for(int j = 0; j < 3; j++)
      {
        if(c[j][i] - c[j][i + 1] != z)
        {
          //System.out.printf("%d %d\n", i, j);
          f = false;
        }
      }
    }

    System.out.println(f ? "Yes" : "No");


  }

}