use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_macros)]
macro_rules! dump (
    ($($arg:tt)*) => { {
        if cfg!(local) {
            let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
            r.expect("failed printing to stderr");
        }
    } }
);

#[allow(dead_code)]
struct Chrono {
    st: std::time::SystemTime,
}

#[allow(dead_code)]
impl Chrono {
    fn new() -> Chrono {
        Chrono { st: std::time::SystemTime::now() }
    }

    fn elapsed_ms(&self) -> i64 {
        let elapsed = self.st.elapsed().unwrap();
        elapsed.as_secs() as i64 * 1000 + elapsed.subsec_nanos() as i64 / 1_000_000
    }

    fn reset(&mut self) {
        self.st = std::time::SystemTime::now();
    }
}

struct Scanner<R: Read> {
    reader: R,
    buffer: String,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    pub fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader, buffer: String::new() }
    }

    pub fn line(&mut self) -> String {
        self.buffer = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|&c| c == '\n' || c == '\r')
            .take_while(|&c| !(c == '\n' || c == '\r'))
            .collect::<String>();
        self.buffer.clone()
    }

    pub fn read_buffer(&mut self) {
        self.buffer = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
    }

    pub fn safe_read<T: FromStr>(&mut self) -> Option<T> {
        self.read_buffer();
        if self.buffer.is_empty() {
            None
        } else {
            self.buffer.parse::<T>().ok()
        }
    }

    pub fn read<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.safe_read() {
            s
        } else {
            if cfg!(local) {
                writeln!(std::io::stderr(), "Terminated with EOF").unwrap();
            }
            std::process::exit(0);
        }
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.read()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }
}

trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item=U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(104_857_600)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
}

fn solve() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    loop {
        let c: Vec<Vec<i32>> = sc.mat(3, 3);
        let mut is = [0, 1, 2];
        let mut js = [0, 1, 2];
        is.sort_by_key(|&i| c[i][0]);
        js.sort_by_key(|&j| c[0][j]);
        let mut d = [[0; 3]; 3];
        for i in 0..3 {
            for j in 0..3 {
                d[i][j] = c[is[i]][js[j]];
            }
        }
        let mut ok = true;
        for i in 0..2 {
            ok &= d[i][1] - d[i][0] == d[i+1][1] - d[i+1][0];
            ok &= d[i][2] - d[i][1] == d[i+1][2] - d[i+1][1];
            ok &= d[1][i] - d[0][i] == d[1][i+1] - d[0][i+1];
            ok &= d[2][i] - d[1][i] == d[2][i+1] - d[1][i+1];
        }
        let ans = if ok {
            "Yes"
        } else {
            "No"
        };
        println!("{}", ans);
    }
}


Measured memory_bytes: 8572