unittest
{
	assert( [ "1 0 1", "2 1 2", "1 0 1" ].parse.expand.solve == "Yes" );
	assert( [ "2 2 2", "2 1 2", "2 2 2" ].parse.expand.solve == "No" );
	assert( [ "0 8 8", "0 8 8", "0 8 8" ].parse.expand.solve == "Yes" );
	assert( [ "1 8 6", "2 9 7", "0 7 7" ].parse.expand.solve == "No" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	long[ 3 ][ 3 ] css;
	foreach( ref cs; css )
	{
		cs = input.front.split.to!( long[] );
		input.popFront;
	}
	return tuple( css );
}

auto solve( long[ 3 ][ 3 ] css )
{
	// 各行の合計の差を検証（各行で同じ値を足しているはずなので行数で割り切れるはず）
	auto ys = new long[ 3 ];
	foreach( i, ref y; ys )
	{
		y = css[ i ][ 0 ] + css[ i ][ 1 ] + css[ i ][ 2 ];
	}
	auto ym = ys.reduce!min;
	if( ( ys[ 0 ] - ym ) % 3 != 0 || ( ys[ 1 ] - ym ) % 3 != 0 || ( ys[ 2 ] - ym ) % 3 != 0 ) return "No";
	
	// 各列の合計の差を検証（各列で同じ値を足しているはずなので列数で割り切れるはず）
	auto xs = new long[ 3 ];
	foreach( i, ref x; xs )
	{
		x = css[ 0 ][ i ] + css[ 1 ][ i ] + css[ 2 ][ i ];
	}
	auto xm = xs.reduce!min;
	if( ( xs[ 0 ] - xm ) % 3 != 0 || ( xs[ 1 ] - xm ) % 3 != 0 || ( xs[ 2 ] - xm ) % 3 != 0 ) return "No";
	
	return "Yes";
}
