jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var s, t string
	fmt.Scan(&s, &t)
	var a, b int
	nextInts(&a, &b)
	var u string
	fmt.Scan(&u)
	if u == s {
		a--
	} else {
		b--
	}
	fmt.Printf("%d %d\n", a, b)
}

var sc *bufio.Scanner

func init() {
	sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
}

func nextInts(ints ...*int) {
	for i := range ints {
		sc.Scan()
		*ints[i], _ = strconv.Atoi(sc.Text())
	}
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
//  [go]
red blue
5 5
blue
//  [ruby]
s,t = gets.chomp.split
a,b = gets.chomp.split.map(&:to_i)
u = gets.chomp

hash = Hash.new(0)
hash[s] = a; hash[t] = b;
hash[u] -= 1
puts "#{hash[s]} #{hash[t]}"
//  [ruby]
line = readlines
len = line.length
i = 0

while i < len
    line[i] = line[i].chomp.split(' ')
    i += 1
end

s = line[0][0]
t = line[0][1]
A = line[1][0].to_i
B = line[1][1].to_i

if line[2][0] == s then
  print (A-1).to_s + " " + B.to_s
else
  print A.to_s + " " + (B-1).to_s
end
//  [ruby]
s,t = gets.split
a,b = gets.split.map(&:to_i)
u = gets.chomp

if s == u
  a -= 1
  puts "#{a} #{b}"
else
  puts "#{a} #{b-1}"
end
//  [ruby]
s,t = gets.chomp.split(" ").map(&:to_s);
a,b = gets.chomp.split(" ").map(&:to_i);
u = gets.chomp.to_s

if u == s then
	puts (a-1).to_s +" " + b.to_s
else
	puts a.to_s + " " + (b-1).to_s
end
//  [ruby]
s,t = gets.chomp.split(" ").map(&:to_s);
a,b = gets.chomp.split(" ").map(&:to_i);
u = gets.to_s

if u ==s then
	puts (a-1).to_s +" " + b.to_s
else
	puts a.to_s + " " + (b-1).to_s
end
//  [ruby]
s,t = gets.chomp.split.map(&:to_s)
a,b = gets.chomp.split.map(&:to_i)
u = gets.to_s

if s == u
  a -= 1
elsif t == u
  b -= 1
end

puts "#{a} #{b}"
//  [rust]
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn input_tuple_str() -> (String, String) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<String> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0].to_string(), vec[1].to_string())
}

fn main() {
    let (s, t) = input_tuple_str();
    let (a, b) = input_tuple();
    let u: String = input();

    if s == u {
        println!("{} {}", a-1, b);
    } else {
        println!("{} {}", a, b-1);
    }
}
//  [rust]
use std::io;
use std::collections::HashMap;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let s = iter.next().unwrap().to_string();
	let t = iter.next().unwrap().to_string();
	
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let a:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	let b:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let u = buf.trim().to_string();
	
	let mut map = HashMap::new();
	map.insert(&s, a);
	map.insert(&t, b);
	if s == u {
		map.insert(&&u, a-1);
	}
	if t == u {
		map.insert(&&u, b-1);
	}
	
	println!("{} {}", map.get(&s).unwrap(), map.get(&t).unwrap());
}
//  [rust]
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        S: Chars,
        T: Chars,
        n: i32,
        m: i32,
        U: Chars
    }
    if S == U {
        println!("{} {}", n-1, m);
    } else {
        println!("{} {}", n, m-1);
    }
}
//  [rust]
use proconio::{input};
use proconio::marker::Chars;

fn main() {
    input! {
        S: Chars,
        T: Chars,
        n: i32,
        m: i32,
        U: Chars
    }
    if S == U {
        println!("{} {}", n-1, m);
    } else {
        println!("{} {}", n, m-1);
    }
}
//  [rust]
use std::io;
use std::collections::HashMap;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let s = iter.next().unwrap().to_string();
	let t = iter.next().unwrap().to_string();
	
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let a:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	let b:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let u = buf.trim().to_string();
	
	let mut map = HashMap::new();
	map.insert(&s, a);
	map.insert(&t, b);
	if s == u {
		map.insert(&&u, a-1);
	}else{
		map.insert(&&u, b-1);
	}
	
	let mut v = Vec::new();
	
	for n in map.values() {
		v.push(n);
	}
	let mut iter = v.iter();
	for val in iter.rev() {
		print!("{} ", val);
	}
	println!("");
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let st = readLine()!.split(separator: " ")
    let s = st[0]
    // let t = st[1]
    
    let ab = readInts()
    let a = ab[0]
    let b = ab[1]
    
    let u = readLine()!
    
    if u == s {
        print(a - 1, b)
    } else {
        print(a, b - 1)
    }
}

main()
//  [swift]
import Foundation

let input_line = readLine()!

var split = input_line.componentsSeparatedByString(" ")
let S = split[0]
let T = split[1]
 
//標準入力二行
let input_line2 = readLine()!
split = input_line2.componentsSeparatedByString(" ")
var A = Int(split[0])!
var B = Int(split[1])!

//標準入力二行
let U = readLine()!
 
if U == S {
  A -= 1
} else {
  B -= 1
}
print(A, B)
//  [swift]
import Foundation
 
let N = Int(readLine()!)!
var array =  readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
var answer = "YES"
_ = array.map {
    //array.remove(value: $0)
	if let i = array.indexOf($0) {
        array.removeAtIndex(i)
    }
    if array.contains($0) {
        answer = "NO"
    }
}
print(answer)
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8");
const [colors, nums, u] = input.split("\n")
const [s, t] = colors.split(" ")
let [a, b] = nums.split(" ").map(x => +x)

if (u === s) a--
if (u === t) b--

console.log(a, b)
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

const [s, t] = input[0].split(' ');
const [a, b] = input[1].split(' ').map((x : string): number => +x);
const u = input[2];

if (u===s){
	console.log(a-1, b);
}else{
	console.log(a,b-1);
}
//  [typescript]
class AtCoder {
  // 入力系
  input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);
  input_i=-1;
  n(){
    this.input_i++;
    return Number(this.input[this.input_i]);
  }
  nn(n):number[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.n());
    }
    return a;
  }
  s(){
    this.input_i++;
    return String(this.input[this.input_i]);
  }
  ss(n):string[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.s());
    }
    return a;
  }

  // コンソール
  o(...a:any){
    console.log(...a);
  }

  // Math
  abs(a:number){
    return Math.abs(a);
  }
  min(...a:number[]){
    return Math.min(...a);
  }
  max(...a:number[]){
    return Math.max(...a);
  }
  floor(a:number){
    return Math.floor(a);
  }
  ceil(a:number){
    return Math.ceil(a);
  }
  round(a:number){
    return Math.round(a);
  }

  // ソート
  asc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return a-b});
  }
  desc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return b-a});
  }

  // 自作
  gcd(...arr):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=x;
    }
    return arr[arr.length-1];
  };
  lcm(...arr):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=arr[i]*arr[i+1]/x;
    }
    return arr[arr.length-1];
  };
  isPrime(n:number):boolean{
    if(n < 2) return false;
    const suq=Math.sqrt(n);
    for(let i=2;i<=suq;i++){
      if(n%i==0){
        return false;
      }
    }return true;
  };
  deduplicate(a:any[]):any[]{
    return Array.from(new Set(a));
  };
}

const o = new AtCoder()
let [a,b]=[...o.ss(2)]
let [n,m]=[...o.nn(2)]
let c=o.s()

if(a==c){
  o.o(n-1+" "+m)
}else{
  o.o(n, m-1)
}
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

const [s, t] = input[0].split(' ');
const [a, b] = input[1].split(' ').map((x : string): number => +x);
const u = input[2];

if (u==='red'){
	console.log(a-1, b);
}else{
	console.log(a,b-1);
}
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

const [s, t] = input[0].split(' ');
const [a, b] = input[1].split(' ').map((x : string): number => +x);
const u = input[2];

if (u==='red'){
	console.log(a-1, b);
}else if (u==='blue'){
	console.log(a,b-1);
}else{
	console.log(a,b);
}
//  [python]
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

diff1 = c21 - c11
diff2 = c31 - c21
if diff1 == (c22-c12) and diff2 == (c32-c22) and diff1 == (c23-c13) and diff2 == (c33-c23):
    print("Yes")
else:
    print("No")
//  [python]
c = [list(map(int,input().split())) for _ in range(3)]

e = c[0][1] - c[0][0]
f = c[0][2] - c[0][1]

if any(e != c[x][1]-c[x][0] for x in [1,2]) or any(f != c[x][2]-c[x][1] for x in [1,2]) :
    print('No')
else:
    print('Yes')
//  [python]
c = [list(map(int, input().split())) for _ in range(3)]
def a(c):
    for j in range(2):
        if not ((c[0][j]-c[0][j+1]) == (c[1][j]-c[1][j+1]) and (c[1][j]-c[1][j+1]) == (c[2][j]-c[2][j+1])):
            return print('No')
        if not ((c[j][0]-c[j+1][0]) == (c[j][1]-c[j+1][1]) and (c[j][1]-c[j+1][1]) == (c[j][2]-c[j+1][2])):
            return print('No')
    return print('Yes')
a(c)
//  [python]
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))

a1_a2 = c1[0] - c2[0]
a2_a3 = c2[0] - c3[0]
b1_b2 = c1[0] - c1[1]
b2_b3 = c1[1] - c1[2]

cnt = 0
if a1_a2 == c1[1]-c2[1] == c1[2]-c2[2]:
    cnt += 1
if a2_a3 == c2[1]-c3[1] == c2[2]-c3[2]:
    cnt += 1
if b1_b2 == c2[0]-c2[1] == c3[0]-c3[1]:
    cnt += 1
if b2_b3 == c2[1]-c2[2] == c3[1]-c2[2]:
    cnt += 1

if cnt == 4:
    print("Yes")
else:
    print("No")
//  [python]
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
if (sum(c1)+sum(c2)+sum(c3))%3 == 0:
    print("Yes")
else:
    print("No")
//  [python]
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

c = []
for i in range(3):
    c.append(list(map(int, input().split())))

for a1 in range(1, 101):
    b1 = c[0][0] - a1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1
    for a2 in range(1, 101):
        if not (b1 == (c[1][0] - a2) and b2 == (c[1][1] - a2) and b3 == (c[1][2] - a2)):
            continue
        for a3 in range(1, 101):
            if (b1 == (c[2][0] - a3) and b2 == (c[2][1] - a3) and b3 == (c[2][2] - a3)):
                print('Yes')
                sys.exit(0)
print('No')
//  [java]
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;



 
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	/*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	
	int[][] c = new int[3][3];
	
//	int ans = -1;
	boolean ans = true;
	
	
	
	
	public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	}
	
	public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	}

	
	public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	}
}

class Point {
	int y;
	int x;
	public Point(int y, int x) {
		this.x=x;
		this.y=y;
	}
	
	public Point move(Point d) {
		Point p = new Point(y, x);
		p.x += d.x;
		p.y += d.y;
		return p;
	}
	
}

class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 100000;
	
	//Fields
	protected InputStream in;
	private byte[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private DataInputStream dis = null;
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);}
	protected void initBuf(int bufsiz) {buf = new byte[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	}
	
	//Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(byte b) {return b=='-'; }

	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}

	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}

}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
	
    public static void main(String[] args) {
    	FastScanner sc = new FastScanner();
    	
    	int c11 = sc.nextInt();
    	int c12 = sc.nextInt();
    	int c13 = sc.nextInt();
    	int c21 = sc.nextInt();
    	int c22 = sc.nextInt();
    	int c23 = sc.nextInt();
    	int c31 = sc.nextInt();
    	int c32 = sc.nextInt();
    	int c33 = sc.nextInt();
    	
    	int b1 = c11;
    	int b2 = c12;
    	int b3 = c13;
    	int a2 = c21 - b1;
    	int a3 = c31 - b1;
    	
    	boolean can = true;
    	
    	if(c22!=a2+b2 || c23!= a2+b3 || c32!= a3+b2 || c33!= a3+b3){
    		can = false;
    	}
    	
    	if(can){
        	System.out.println("Yes");
    	}
    	else{
        	System.out.println("No");
    	}
    }
    
}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        MyReader reader = new MyReader();
        int[][] cs = new int[3][3];
        cs[0] = reader.readInts(" ");
        cs[1] = reader.readInts(" ");
        cs[2] = reader.readInts(" ");
        System.out.println(problem088c(cs));
    }

    private static String problem088c(int[][] cs) {
        int[] as = {-1, -1, -1};
        int[] bs = {-1, -1, -1};

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int n = cs[i][j];
                as[i] = Math.max(as[i], n);
                bs[j] = Math.max(bs[j], n);
            }
        }

        int a, b;
        for (int a1 = 0; a1 <= as[0]; a1++) {
            for (int a2 = 0; a2 <= as[1]; a2++) {
                for (int a3 = 0; a3 <= as[2]; a3++) {
                    for (int b1 = 0; b1 <= bs[0]; b1++) {
                        for (int b2 = 0; b2 <= bs[1]; b2++) {
                            whole:
                            for (int b3 = 0; b3 <= bs[2]; b3++) {
                                for (int i = 0; i < 3; i++) {
                                    a = (i == 0) ? a1 : ((i == 1) ? a2 : a3);
                                    for (int j = 0; j < 3; j++) {
                                        b = (j == 0) ? b1 : ((j == 1) ? b2 : b3);
                                        if ((a + b) != cs[i][j]) continue whole;
                                    }
                                }
                                return  "Yes";
                            }
                        }
                    }
                }
            }
        }
        return "No";
    }

    private static class MyReader {
        private final BufferedReader br;
        private MyReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        private String readString() throws IOException {
            return br.readLine();
        }

        private int readInt() throws IOException {
            return Integer.parseInt(readString());
        }

        private String[] readStrings(String regex) throws IOException {
            return readString().split(regex);
        }

        private int[] readInts(String regex) throws IOException {
            String[] strings = readStrings(regex);
            int[] ints = new int[strings.length];
            for (int i = 0; i < ints.length; i++) {
                ints[i] = Integer.parseInt(strings[i]);
            }
            return ints;
        }
    }
}
//  [java]
import java.util.*;
class Main{
  static Scanner sc=new Scanner(System.in);
  public static void main(String args[]){
    int c[][] = new int[3][3];
    boolean F=false;
    for(int i=0;i<3;++i){
      for(int j=0;j<3;++j){
        c[i][j]=sc.nextInt();
      }
    }
    for(int a1=0;a1<=50&&!F;a1++){
      for(int a2=0;a2<=50&&!F;a2++){
        for(int a3=0;a3<=50&&!F;a3++){
          int b1=c[0][0]-a1,b2=c[0][1]-a1,b3=c[0][2]-a1;
          boolean L2,L3;
          L2=(c[1][0]==a2+b1&&c[1][1]==a2+b2&&c[1][2]==a2+b3);
          L3=(c[2][0]==a3+b1&&c[2][1]==a3+b2&&c[2][2]==a3+b3);
          F=L2&&L3;
        }
      }
    }
    System.out.println(F?"Yes":"No");
  }
}
//  [java]
import java.util.Arrays;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int[][] c = new int[3][3];
    int maxind = 0;
    int max = 0;

    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        c[i][j] = sc.nextInt();
      }
    }

    while (true) {
      max = 0;
      maxind = 0;
      boolean ok = true;
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          if (max < c[i][j]) {
            max = c[i][j];
            maxind = i;
          }
        }
      }

      for (int j = 0; j < 3; j++) {
        c[maxind][j] = Math.max(c[maxind][j] - 1, 0);
      }

      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          if (c[i][j] != 0) {
            ok = false;
            break;
          }
        }
      }

      if (ok) {
        System.out.println("No");
        return;
      }

      if (Arrays.equals(c[0], c[1]) && Arrays.equals(c[1], c[2])) {
        System.out.println("Yes");
        return;
      }

    }

  }
}
//  [cpp]
#include <iostream>
using namespace std;

int main() {
  int c[9];
  for(int i = 0; i < sizeof(c); i++) cin >> c[i];
  cout << (c[0]+c[4]+c[8] == c[1]+c[5]+c[6] && c[0]+c[4]+c[8] == c[2]+c[3]+c[7] ? "Yes" : "No") <<endl;
}
//  [cpp]
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int c[3][3];
    int b1,b2,b3;
    for(int i=0;i<3;++i){
        for(int j=0;j<3;++j){
            cin>>c[i][j];
        }
    }
    bool ret = false;
    for(int a1=0;a1<=100;++a1){
        b1=c[0][0]-a1;
        b2=c[0][1]-a1;
        b3=c[0][2]-a1;
        if(b1<0 || b2<0 || b3<0)break;
        for(int a2=0;a2<=100;++a2){
            if(c[1][0]==a2+b1 && c[1][1]==a2+b2 && c[1][2]==a2+b3){
                for(int a3=0;a3<=100;++a3){
                    if(c[2][0]==a3+b1 && c[2][1]==a3+b2 && c[2][2]==a3+b3){
                        ret = true;
                        break;
                    }
                }
            }
            if(ret)break;
        }
        if(ret)break;
    }
    ret ==true ? cout<<"Yes"<<endl : cout << "No"<< endl;
    
    return 0;
}
//  [cpp]
#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <cmath>
#include <map>
#define INF 1000000000
using namespace std;
map<int, int> mp;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a[3][3];
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> a[i][j];
		}
		a[i][1] -= a[i][0];
		a[i][2] -= a[i][0];
		a[i][0] = 0;
	}
	for (int i = 0; i < 3; i++) {
		if (!(a[0][i] == a[1][i] && a[1][i] == a[2][i])) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main () {
	long long  c[3][3];
	long long  a[3]={0};
	long long b[3]={0};
	for (int i=1; i<=3; i++) {
		for (int j=1; j<=3; j++) {
			cin >> c[i][j];
		}
	}
	b[1] = c[1][1];
	b[2] = c[1][2];
	b[3] = c[1][3];
	a[1] = 0;
	a[2] = c[2][2] - b[2];
	a[3] = c[3][3] - b[3];
	for (int i=1; i<=3; i++) {
		for (int j=1; j<=3; j++) {
			if (c[i][j]!=a[i]+b[j]) {
				cout << "No";
				return 0;
			}
		}
	}
	cout << "Yes";
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main () {
	int c[3][3];
	int a[3]={0};
	int b[3]={0};
	for (int i=1; i<=3; i++) {
		for (int j=1; j<=3; j++) {
			cin >> c[i][j];
		}
	}
	b[1] = c[1][1];
	b[2] = c[1][2];
	b[3] = c[1][3];
	a[1] = 0;
	a[2] = c[2][2] - b[2];
	a[3] = c[3][3] - b[3];
	for (int i=1; i<=3; i++) {
		for (int j=1; j<=3; j++) {
			if (c[i][j]!=a[i]+b[j]) {
				cout << "No";
				return 0;
			}
		}
	}
	cout << "Yes";
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int sum = 0;
  rep(i,3)rep(j,3) {
    int c;
    cin >> c;
    sum += c;
  }
  if(sum % 3 == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
//  [c]
#include <stdio.h>
int main(void){

    int c[3][3];
    for(int i=0;i<3;++i){
        for(int l=0;l<3;++l){
            int a;
            scanf("%d",&a);
            c[i][l] = a;
        }
    }
    if(c[0][0] + c[1][1] ==  c[0][1] + c[1][0]){
        if(c[1][0] + c[2][1] ==  c[2][0] + c[1][1]){
            if(c[0][1] + c[1][2] ==  c[0][2] + c[1][1]){
                if(c[1][1] + c[2][2] ==  c[1][2] + c[2][1]){
                    printf("Yes");
                    return 0;
                }
            }
        }
    }
    printf("No");
    return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	int c[3][4]={0},i,j;
	for(i=1;i<4;i++){
		for(j=1;j<4;j++){
			scanf("%d",&c[i][j]);
		}
	}
	for(i=1;i<3;i++){
		for(j=i;j<4;j++){
			if(c[i][i]+c[j][j]-c[i][j]-c[j][i]){
				printf("No");
				return 0;
			}
		}
	}
	printf("Yes");
	return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
#define charsize 100005 //10^5+5

void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}

int main(void){
    // char ;
    // ll n,ans=0;
    // scanf("%lld",&n);
    ll c[3][3],a[3],b[3];
    rep(i,0,3){
        rep(j,0,3) scanf("%lld",&c[i][j]);
    }
    a[0]=0;
    rep(i,0,3){
        b[i]=c[0][i]-a[0];
    }
    rep(i,1,3){
        a[i]=c[i][0]-b[0];
    }
    if(c[1][1]==a[1]+b[1] && c[1][2]==a[1]+b[2] && c[2][1]==a[2]+b[1] && c[2][2]==a[2]+b[2]){
        YES;
    }else{
        NO;
    }

    
    // printf("%lld\n");
    return 0;
}
//  [c]
#include <stdio.h>
int main(void){
  int a11,a12,a13,a21,a22,a23,a31,a32,a33,i,j,k,l;
  scanf("%d %d %d \n %d %d %d \n %d %d %d",&a11,&a12,&a13,&a21,&a22,&a23,&a31,&a32,&a33);
  for(i=0;i<101;i++){
    for(j=0;j<101;j++){
      for(k=0;k<101;k++){
        for(l=0;l<101;l++){
          if(i==a12 && j==a13 && k==a21 && l==a31){
            printf("Yes\n");
          }
        }
      }
    }
  }
  printf("No\n");
  return 0;
}
//  [c]
#include <stdio.h>
int main(void){
  int a11,a12,a13,a21,a22,a23,a31,a32,a33,i,j,k,l;
  scanf("%d %d %d %d %d %d %d %d %d",&a11,&a12,&a13,&a21,&a22,&a23,&a31,&a32,&a33);
  for(i=0;i<101;i++){
    for(j=0;j<101;j++){
      for(k=0;k<101;k++){
        for(l=0;l<101;l++){
          if(i==a12 && j==a13 && k==a21 && l==a31){
            printf("Yes\n");
          }
        }
      }
    }
  }
  printf("No\n");
  return 0;
}
//  [c]
#include <stdio.h>

int main()
{
    int c[4][4];
    int i, j;

    for(i=1; i<4; i++){
        for(j=1; j<4; j++){
            scanf("%d", &c[i][j]);
        }
    }

    if(c[1][1]-c[1][2] != c[2][1]-c[2][2]) {
        printf("no\n");
        return 0;
    }if(c[1][1]-c[1][3] != c[2][1]-c[2][3]) {
        printf("no\n");
        return 0;
    }if(c[1][2]-c[1][3] != c[2][2]-c[2][3]) {
        printf("no\n");
        return 0;
     }if(c[1][1]-c[1][2] != c[3][1]-c[3][2]) {
        printf("no\n");
        return 0;
     }if(c[1][1]-c[1][3] != c[3][1]-c[3][3]) {
        printf("no\n");
        return 0;
    }if(c[1][2]-c[1][3] != c[3][2]-c[3][3]) {
        printf("no\n");
        return 0;
    }if(c[2][1]-c[2][2] != c[3][1]-c[3][2]) {
        printf("no\n");
        return 0;
    }if(c[2][1]-c[2][3] != c[3][1]-c[3][3]) {
        printf("no\n");
        return 0;
    }if(c[2][2]-c[2][3] != c[3][2]-c[3][3]) {
        printf("no\n");
        return 0;
    }
    printf("yes\n");
    return 0;
}
//  [javascript]
function Main(input) {
    var c1 = changeNumber(input.split('\n')[0].split(' '));
    var c2 = changeNumber(input.split('\n')[1].split(' '));
    var c3 = changeNumber(input.split('\n')[2].split(' '));
    function changeNumber(c){
        var box =[];
        for(var k =0; k<3; k++){
            box.push(Number(c[k]));
        }
        return box;
    }
    var c = [];
    c.push(c1);
    c.push(c2);
    c.push(c3);
    var ans="No";
    if(c[2][2]-c[1][2]===c[2][1]-c[1][1]&&
       c[2][1]-c[1][1]===c[2][0]-c[1][0]&&
       c[1][2]-c[0][2]===c[1][1]-c[0][1]&&
       c[1][1]-c[0][1]===c[1][0]-c[0][0]&&
       c[0][2]-c[0][1]===c[1][2]-c[1][1]&&
       c[1][2]-c[1][1]===c[2][2]-c[2][1]&&
       c[0][1]-c[0][0]===c[1][1]-c[1][0]&&
       c[1][1]-c[1][0]===c[2][1]-c[2][0]){
    ans="Yes";
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict"
function Main(input) {
  input = input.trim().split('\n');
  let h = input[0].trim().split(' ').map(Number);
  let m = input[1].trim().split(' ').map(Number);
  let l = input[2].trim().split(' ').map(Number);

  let x = [m[0]-h[0], m[1]-h[1], m[2]-h[2]]
  let y = [l[0]-m[0], l[1]-m[1], l[2]-m[2]]

  if(x[0] === x[1] && x[1] === x[2]){
    if(y[0] === y[1] && y[1] === y[2]){
      console.log('Yes');
      return;
    }
  }
  console.log('No');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

function main(input) {
  const lines = input.split('\n');

  const c = [];
  for(let i=0;i<3;i++){
    c.push(lines[i].split(' ').map(x => parseInt(x)))
  }

  let result = 'Yes';

  if(c[1][1]+c[2][2] != c[1][2]+c[2][1]){result='No';}
  if(c[0][0]+c[1][1] != c[0][1]+c[1][0]){result='No';}
  if(c[0][0]+c[2][2] != c[0][2]+c[2][0]){result='No';}

  console.log(result);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var lines = [];

var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var c = lines.map(i => i.split(" ").map(i => Number(i)));
    
    // Aiを表す
    for (var a1 = 0; a1 < 100; a1++) {
        var b1 = c[0][0] - a1
        var b2 = c[1][0] - a1
        var b3 = c[2][0] - a1

        // Biを表す
        for (var a2 = 0; a2 < 100; a2++) {
            if (a2 + b1 !== c[0][1]) { continue }
            if (a2 + b2 !== c[1][1]) { continue }
            if (a2 + b3 !== c[2][1]) { continue }

            // Ciを表す
            for (var a3 = 0; a3 < 100; a3++) {
                if (a3 + b1 !== c[0][2]) { continue }
                if (a3 + b2 !== c[1][2]) { continue }
                if (a3 + b3 !== c[2][2]) { continue }

                console.log("Yes");
                return (0)
            }
        }
    }
    console.log("No")

});
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	var line = input.split("\n");
	var c = [];
	c[0] = line[0].split(" ");
	c[1] = line[1].split(" ");
	c[2] = line[2].split(" ");
	var sum = 0;
	for(var i = 0; i < c.length; i++){
		for(var j = 0; j < c[i].length; j++){
			c[i][j] = Number(c[i][j]);
			sum += c[i][j];
		}
	}
	if(sum%3 !== 0){
		console.log('No');
	} else{
		var difcol = [c[0][1]-c[0][0], c[0][2]-c[0][1]];
		var difrow = [c[1][0]-c[0][0], c[2][0]-c[1][0]];
		if(c[1][1]-c[1][0] !== difcol[0] || c[1][2]-c[1][0] !== difcol[1]){
			console.log('No');
		} else if(c[2][1]-c[2][0] !== difcol[0] || c[2][2]-c[2][1] !== difcol[1]){
			console.log('No');
		} else if(c[1][1]-c[0][1] !== difrow[0] || c[2][1]-c[1][1] !== difrow[1]){
			console.log('No');
		} else if(c[1][2]-c[0][2] !== difrow[0] || c[2][2]-c[1][2] !== difrow[1]){
			console.log('No');
		} else{
			console.log('Yes');
		}
	}
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var box = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n').map(e => e.split(' ').map(e => parseInt(e)));
var a = [Math.min(box[0][0], box[0][1], box[0][2]), Math.min(box[1][0], box[1][1], box[1][2]), Math.min(box[2][0], box[2][1], box[2][2])];
var b = [Math.min(box[0][0], box[1][0], box[2][0]), Math.min(box[0][1], box[1][1], box[2][1]), Math.min(box[0][2], box[1][2], box[2][2])];
var res = 'Yes';
for (var i = 0; res !='No' && i < 3; i++) for (var j = 0; res !='No' && j < 3; j++) box[i][j] != (a[i] + b[j]) ? res = 'No':'';
console.log(res);
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

//Main
var sc = bufio.NewScanner(os.Stdin)
var c [][]int

func main() {
	sc.Split(bufio.ScanWords)
	c = make([][]int, 3)
	for i := 0; i < 3; i++ {
		c[i] = []int{nextInt(), nextInt(), nextInt()}
	}

	ans := "No"

	for a1 := 0; a1 <= 100; a1++ {
		b1 := c[0][0] - a1
		b2 := c[0][1] - a1
		b3 := c[0][2] - a1
		if b1 < 0 || b2 < 0 || b3 < 0 {
			continue
		}
		if c[1][0]-b1 != c[1][1]-b2 || c[1][1]-b2 != c[1][2]-b3 {
			continue
		}
		if c[2][0]-b1 != c[2][1]-b2 || c[2][1]-b2 != c[2][2]-b3 {
			continue
		}
		ans = "Yes"
		break
	}

	fmt.Println(ans)

}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func main() {
	sc.Split(bufio.ScanWords)
	c := [4][4]int{}
	for i := 1; i <= 3; i++ {
		for j := 1; j <= 3; j++ {
			c[i][j] = getInt()
		}
	}
	ans := true
	if c[1][1]-c[1][2] != c[2][1]-c[2][2] {
		ans = false
	}
	// out(ans)
	if c[1][1]-c[1][2] != c[3][1]-c[3][2] {
		ans = false
	}
	// out(ans)

	if c[1][2]-c[1][3] != c[2][2]-c[2][3] {
		ans = false
	}
	// out(ans)
	if c[1][2]-c[1][3] != c[3][2]-c[3][3] {
		ans = false
	}
	// out(ans)

	if c[1][1]-c[2][1] != c[1][2]-c[2][2] {
		ans = false
	}
	// out(ans)
	if c[1][1]-c[2][1] != c[1][3]-c[2][3] {
		ans = false
	}
	// out(ans)

	if c[2][1]-c[3][1] != c[2][2]-c[3][2] {
		ans = false
	}
	// out(ans)
	if c[2][1]-c[3][1] != c[2][3]-c[3][3] {
		ans = false
	}
	// out(ans)

	if ans == true {
		out("Yes")
	} else {
		out("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"
	"strconv"
)

func main() {
	c := make([][]int, 3)
	for i := range c {
		c[i] = append(c[i], readInt())
		c[i] = append(c[i], readInt())
		c[i] = append(c[i], readInt())
	}

	for b1 := 0; b1 <= 100; b1++ {
		a := []int{c[0][0] - b1, c[1][0] - b1, c[2][0] - b1}
		b := []int{b1, c[0][1] - a[0], c[0][2] - a[0]}
		// fmt.Println(a, b)

		ok := true
	label:
		for i := range c {
			for j := range c[i] {
				if c[i][j] != a[i]+b[j] {
					ok = false
					break label
				}
			}
		}
		if ok {
			fmt.Println("Yes")
			return
		}
	}

	fmt.Println("No")
}

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	log.SetFlags(log.Lshortfile)
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readInt() int {
	return int(readInt64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}
//  [go]
package main

import "fmt"

func main() {
	grid := make([][]int, 3)

	for i := range grid {
		grid[i] = make([]int, 3)
		if i != 2 {
			fmt.Scanf("%d %d %d\n", &grid[i][0], &grid[i][1], &grid[i][2])
		} else {
			fmt.Scanf("%d %d %d", &grid[i][0], &grid[i][1], &grid[i][2])
		}
	}

	a := make([]int, 3)
	b := make([]int, 3)

	a[0] = 0
	b[0] = grid[0][0]
	b[1] = grid[1][0]
	b[2] = grid[2][0]
	a[1] = grid[0][1] - b[0]
	a[2] = grid[0][2] - b[0]

	flg := true
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			if grid[i][j] == (a[j] + b[i]) {
				continue
			} else {
				flg = false
			}
		}
	}

	if flg {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}
//  [go]
package main

import "fmt"

func main() {
	grid := make([][]int, 3)

	for i := range grid {
		grid[i] = make([]int, 3)
		fmt.Scanf("%d %d %d\n", &grid[i][0], &grid[i][1], &grid[i][2])
	}

	a := make([]int, 3)
	b := make([]int, 3)

	a[0] = 0
	b[0] = grid[0][0]
	b[1] = grid[1][0]
	b[2] = grid[2][0]
	a[1] = grid[0][1] - b[0]
	a[2] = grid[0][2] - b[0]

	flg := true
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			if grid[i][j] == (a[j] + b[i]) {
				continue
			} else {
				flg = false
			}
		}
	}

	if flg {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}
//  [ruby]
ary = []
3.times do |i|
    ary[i] = gets.split.map(&:to_i)
end
a1 = 0
b1 = ary[0][0] - a1
b2 = ary[0][1] - a1
b3 = ary[0][2] - a1
a2 = ary[1][0] - b1
a3 = ary[2][0] - b1
if (a1 + b1 == ary[0][0] &&
    a1 + b2 == ary[0][1] &&
    a1 + b3 == ary[0][2] &&
    a2 + b1 == ary[1][0] &&
    a2 + b2 == ary[1][1] &&
    a2 + b3 == ary[1][2] &&
    a3 + b1 == ary[2][0] &&
    a3 + b2 == ary[2][1] &&
    a3 + b3 == ary[2][2])
    puts 'Yes'
else
    puts 'No'
end
//  [ruby]
cs = 3.times.map{gets.chomp.split.map(&:to_i)}

a = [[0,0],[1,1],[2,2]].inject(0){|sum,(i,j)| sum += cs[i][j]}
b = [[0,2],[1,1],[2,0]].inject(0){|sum,(i,j)| sum += cs[i][j]}
c = [[0,0],[1,2],[2,1]].inject(0){|sum,(i,j)| sum += cs[i][j]}
d = [[0,1],[1,0],[2,2]].inject(0){|sum,(i,j)| sum += cs[i][j]}

puts [a,b,c,d].uniq.size == 1 ? "Yes" : "No"
//  [ruby]
c = readlines.map{|line| line.chomp.split.map(&:to_i)}
b = c[0].map{|i| i - c[0][0]}
a = (0..2).map{|j| c[j][0] - b[0]}
d = (0..2).map{|i| (0..2).map{|j| a[i] + b[j]}}

puts c == d ? :Yes : :No
//  [ruby]
c=[]
3.times do
  c << gets.split.map(&:to_i)
end
if c[0][1]-c[0][0]==c[1][1]-c[1][0]&&c[1][1]-c[1][0]==c[2][1]-c[2][0]||c[0][2]-c[0][1]==c[1][2]-c[1][1]&&c[1][2]-c[1][1]==c[2][2]-c[2][1]||c[1][0]-c[0][0]==c[1][1]-c[0][1]&&c[1][1]-c[0][1]==c[1][2]-c[0][2]||c[2][0]-c[1][0]==c[2][1]-c[1][1]&&c[2][1]-c[1][1]==c[2][2]-c[1][2]
  puts "Yes"
else
  puts "No"
end
//  [ruby]
ary = []
3.times do |i|
    ary[i] = gets.split.map(&:to_i)
end
max_n = ary.flatten.max
0.upto(max_n) do |a1|
    0.upto(max_n) do |b1|
        0.upto(max_n) do |a2|
            0.upto(max_n) do |b2|
                a3 = ary[2][0] - b1
                b3 = ary[0][2] - a1
                if (a1 + b1 == ary[0][0] &&
                    a1 + b2 == ary[0][1] &&
                    a1 + b3 == ary[0][2] &&
                    a2 + b1 == ary[1][0] &&
                    a2 + b2 == ary[1][1] &&
                    a2 + b3 == ary[1][2] &&
                    a3 + b1 == ary[2][0] &&
                    a3 + b2 == ary[2][1] &&
                    a3 + b3 == ary[2][2])
                    puts 'Yes'
                    exit
                end
            end
        end
    end
end
puts 'No'
//  [ruby]
ary = []
3.times do |i|
    ary[i] = gets.split.map(&:to_i)
end
max_n = ary.flatten.max
0.upto(max_n) do |a1|
    0.upto(max_n) do |a2|
        0.upto(max_n) do |a3|
            0.upto(max_n) do |b1|
                0.upto(max_n) do |b2|
                    0.upto(max_n) do |b3|
                        if (a1 + b1 == ary[0][0] &&
                            a1 + b2 == ary[0][1] &&
                            a1 + b3 == ary[0][2] &&
                            a2 + b1 == ary[1][0] &&
                            a2 + b2 == ary[1][1] &&
                            a2 + b3 == ary[1][2] &&
                            a3 + b1 == ary[2][0] &&
                            a3 + b2 == ary[2][1] &&
                            a3 + b3 == ary[2][2])
                            puts 'Yes'
                            exit
                        end
                    end
                end
            end
        end
    end
end
puts 'No'
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::collections::BinaryHeap;

fn main() {
    let mut map: Vec<Vec<i64>> = vec![vec![0; 3]; 3];

    for i in 0..3 {
        for j in 0..3 {
            map[i][j] = read();
        }
    }

    for a1 in 0..100 {
        let b1 = map[0][0] - a1;
        let b2 = map[0][1] - a1;
        let b3 = map[0][2] - a1;

        let a2 = map[1][0] - b1;
        let a3 = map[2][0] - b1;

        if b2 + a2 == map[1][1]
            && b3 + a2 == map[1][2]
            && b2 + a3 == map[2][1]
            && b3 + a3 == map[2][2]
        {
            println!("Yes");
            return;
        }
    }
    println!("No");
}
//  [rust]
macro_rules !input {(source =$s :expr ,$($r :tt ) *) =>{let mut iter =$s .split_whitespace () ;let mut next =||{iter .next () .unwrap () } ;input_inner !{next ,$($r ) *} } ;($($r :tt ) *) =>{let stdin =std ::io ::stdin () ;let mut bytes =std ::io ::Read ::bytes (std ::io ::BufReader ::new (stdin .lock () ) ) ;let mut next =move ||->String {bytes .by_ref () .map (|r |r .unwrap () as char ) .skip_while (|c |c .is_whitespace () ) .take_while (|c |!c .is_whitespace () ) .collect () } ;input_inner !{next ,$($r ) *} } ;}
macro_rules !input_inner {($next :expr ) =>{} ;($next :expr ,) =>{} ;($next :expr ,$var :ident :$t :tt $($r :tt ) *) =>{let $var =read_value !($next ,$t ) ;input_inner !{$next $($r ) *} } ;}
macro_rules !read_value {($next :expr ,($($t :tt ) ,*) ) =>{($(read_value !($next ,$t ) ) ,*) } ;($next :expr ,[$t :tt ;$len :expr ] ) =>{(0 ..$len ) .map (|_ |read_value !($next ,$t ) ) .collect ::<Vec <_ >>() } ;($next :expr ,chars ) =>{read_value !($next ,String ) .chars () .collect ::<Vec <char >>() } ;($next :expr ,usize1 ) =>{read_value !($next ,usize ) -1 } ;($next :expr ,$t :ty ) =>{$next () .parse ::<$t >() .expect ("Parse error" ) } ;}

fn main() {
   input! {
      c: [[i32; 3]; 3]
   }
   let b: Vec<_> = (0..3).map(|i| c[0][i]).collect();
   let a: Vec<_> = (0..3).map(|i| c[i][0] - b[0]).collect();
   for i in 0..3 {
      for j in 0..3 {
         if a[i] + b[j] != c[i][j] {
            println!("No");
            return;
         }
      }
   }
   println!("Yes");
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    c: [[usize; 3]; 3]
    }
    for i in  0..2{
        for j in 0..2{
            if c[i][j + 1] + c[i + 1][j] != c[i][j] + c[i + 1][j + 1]{
                println!("No");
                return
            }
        }
    }
    println!("Yes")
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::VecDeque;

fn main() {
    input! {
        Css: [[i64; 3]; 3],
    }

    let a0 = 0;
    for a1 in 0..=100 {
        for a2 in 0..=100 {
            let As = vec![a0, a1, a2];
            let Bs = vec![Css[0][0] - As[0], Css[0][1] - As[0], Css[0][2] - As[0]];

            let mut is_ok = true;
            for i in 0..3 {
                for j in 0..3 {
                    if Css[i][j] != As[i] + Bs[j] {
                        is_ok = false;
                    }
                }
            }

            if is_ok {
                println!("Yes");
                return;
            }
        }
    }

    println!("No");
}