A guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his favorite hockey team. And, as the boy loves hockey very much, even more than physics, he forgot to do the homework. Specifically, he forgot to complete his physics tasks. Next day the teacher got very angry at Vasya and decided to teach him a lesson. He gave the lazy student a seemingly easy task: You are given an idle body in space and the forces that affect it. The body can be considered as a material point with coordinates (0; 0; 0). Vasya had only to answer whether it is in equilibrium. "Piece of cake" — thought Vasya, we need only to check if the sum of all vectors is equal to 0. So, Vasya began to solve the problem. But later it turned out that there can be lots and lots of these forces, and Vasya can not cope without your help. Help him. Write a program that determines whether a body is idle or is moving by the given vectors of forces.

The first line contains a positive integer n (1 ≤ n ≤ 100), then follow n lines containing three integers each: the xi coordinate, the yi coordinate and the zi coordinate of the force vector, applied to the body ( - 100 ≤ xi, yi, zi ≤ 100).

Print the word "YES" if the body is in equilibrium, or the word "NO" if it is not.

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});
let count;
let td1 = 0, td2 = 0, td3 = 0;
rl.on('line', (line) => {
    if (!count) {
        count = parseInt(line);
        return;
    }
    count--;
    [d1, d2, d3] = line.split(' ').map(Number);
    td1 += d1;
    td2 += d2;
    td3 += d3;
    if (count === 0) {
        console.log(td1 === 0 && td2 === 0 && td3 === 0 ? "YES" : "NO");
    }
});

// 69A - Young Physicist
// http://codeforces.com/problemset/problem/69/A

function main() {
    let n = parseInt(read());
    let a = [0, 0, 0];
    for (let i = 0; i < n; i++) {
        for (let j = 0; j < 3; j++) {
            let x = parseInt(read());
            a[j] += x;
        }
    }

    for (let i = 0; i < 3; i++) {
        if (a[i] !== 0) {
            writeline("NO");
            return 0;
        }
    }
    writeline("YES");
    return 0;
}

var input = "";
var read;
var writeline = (x) => process.stdout.write(x + "\n");
var write = (x) => process.stdout.write(x);
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", (chunk) => input += chunk);
process.stdin.on("end", () => {
    input = input.trim().split(/\s+/);
    read = () => input.shift();
    process.exit(main() || 0);
});

'use strict'

const {EOL} = require('os')

let ipt = ''
process.stdin.on('data', s => ipt += s)
process.stdin.on('end', () => {
  const V = ipt.split(EOL).slice(1, -1).map(l => l.split(' ').map(v => parseInt(v)))
  const res = V.reduce(([xr, yr, zr], [xv, yv, zv]) =>
    [xr + xv, yr + yv, zr + zv]
  , [0, 0, 0])
  console.log(res.every(v => v == 0) ? 'YES' : 'NO')
})

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  var T = readline();

  let matrix = [];

  while (T-- > 0) {
    let vector = readline()
      .split(' ')
      .map((int) => parseInt(int));

    matrix.push(vector);
  }

  let sumX = 0;
  let sumY = 0;
  let sumZ = 0;

  for (let i = 0; i < matrix.length; i++) {
    let vector = matrix[i];
    sumX += vector[0];
    sumY += vector[1];
    sumZ += vector[2];
  }

  if (sumX === 0 && sumY === 0 && sumZ === 0) {
    console.log('YES');
  } else {
    console.log('NO');
  }
}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStd) => {
  inputString += inputStd;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let t = +readLine();
  const data = [];
  while (t--) {
    const row = readLine()
      .split(" ")
      .map((n) => parseInt(n));
    data.push(row);
  }

  for (let col = 0; col < 3; col++) {
    let sum = 0;
    for (let row = 0; row < data.length; row++) {
      sum += data[row][col];
    }
    if (sum !== 0) {
      console.log("NO");
      return;
    }
  }
  console.log("YES");
}

let readline = require('readline');
let rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
	terminal: false
});
input = [];
rl.on('line', function(line) {
	input.push(line);
	if (input.length === input[0] * 1 + 1) {
		youngPhysicist(input);
		rl.close();
	}
});

//M N
let youngPhysicist = (input) => {
	input.shift();
	let input2 = input.map((el) => {
		return el.split(' ');
	});
	let x = 0,
		y = 0,
		z = 0;
	for (let i = 0; i < input2.length; i++) {
		x += input2[i][0] * 1;
		y += input2[i][1] * 1;
		z += input2[i][2] * 1;
	}
	if (x === 0 && y === 0 && z === 0) {
		console.log('YES');
	} else {
		console.log('NO');
	}
};

const readline = require('readline')

let inputs = []

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})
rl.on('close', () => {
    let n = parseInt(inputs[0]);
    let forces = []

    for (let i = 1; i < n + 1; i++) {
        const coordinate = inputs[i].split(' ').map(num => parseInt(num))
        forces.push(coordinate)
    }

    const xSum = forces.map(elem => elem[0]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    const ySum = forces.map(elem => elem[1]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    const zSum = forces.map(elem => elem[1]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    if (xSum != 0 || ySum != 0 || zSum != 0)
        return console.log('NO')
    else
        return console.log("YES")

})

const {EOL} = require('os');

let inp = '';

process.stdin.on('data', c => inp += c);

process.stdin.on('end', () => {
    let lines = inp.split(EOL);
    lines.map(c => c.trim());

    let n = +lines.unshift();

    lines = lines.map(c => c.split(' ').map(r => +r));

    let net = [0, 0, 0];

    for(let i = 0; i < n - 1; i++)  {
    	net[0] += lines[i + 1][0];
    	net[1] += lines[i + 1][1];
    	net[2] += lines[i + 1][2];
    }

    if(!(net[0] || net[1] || net[2]))  {
    	process.stdout.write("YES");
    }  else  {
    	process.stdout.write("NO");
    }
});

//Young Physicist

const {EOL} = require('os');

let inp = '';

process.stdin.on('data', c => inp += c);

process.stdin.on('end', () => {
    let lines = inp.split(EOL);
    lines.map(c => c.trim());

    let n = +lines.shift();

    lines = lines.map(c => c.split(' ').map(r => +r));

    let net = [0, 0, 0];

    for(let i = 0; i < n; i++)  {
    	net[0] += lines[i][0];
    	net[1] += lines[i][1];
    	net[2] += lines[i][2];
    }

    if(!(net[0] || net[1] || net[2]))  {
    	process.stdout.write("YES");
    }  else  {
    	process.stdout.write("NO");
    }
});

const input = [];

function splbsi(line) {
  return line.split(" ").map((x) => parseInt(x));
}

const readLine = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

readLine.on("line", (line) => {
  input.push(line);
});

readLine.on("close", () => {
  const n = parseInt(input[0]);

  let s = [0, 0, 0];
  for (let i = 1; i <= n; i += 1) {
    const [x, y, z] = splbsi(input[i]);
    s[0] += x; s[1] += y; s[2] += z;
  }

  console.log(s[0] === 0 && s[1] === 0 && s[2] === 0 ? "YES" : "NO")
});

const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});
const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let x = 0, y = 0, z = 0;
  input.forEach( (line, i) => {
    if (i === 0) return;
    const nums = line.split(' ').map(x => parseInt(x));
    x += nums[0]; y += nums[1]; z += nums[2];
  });

  console.log(
    x === 0 && y === 0 && z === 0 ? "YES" : "NO"
  );
});

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function main() {
	let n = readLine() >> 0,
		m = n;
	const arr = [];

	while (n--) {
		const vector = readLine()
			.split(' ')
			.map(x => x >> 0);
		arr.push(vector);
	}

	let nonZero = false,
		sum = 0;

	for (let i = 0; i < 3; i++) {
		sum = 0;
		for (let j = 0; j < m; j++) {
			sum += arr[j][i];
		}

		if (sum !== 0) {
			nonZero = true;
			break;
		}
	}

	nonZero ? console.log('NO') : console.log('YES');
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}

function main() {
    const n = parseInt(readLine());
    let AllX = [];
    let AllY = [];
    let AllZ = [];

    for (let i = 0; i < n; i++) {
        const numsArray = readLine().split(' ').map(Number);
        const [x, y, z] = numsArray;
        AllX.push(x);
        AllY.push(y);
        AllZ.push(z);
    }
    let sumX = AllX.reduce((a, b) => {
        return a + b;
    }, 0);
    let sumY = AllY.reduce((a, b) => {
        return a + b;
    }, 0);
    let sumZ = AllZ.reduce((a, b) => {
        return a + b;
    }, 0);
    if (sumX === 0 && sumY === 0 && sumZ === 0) {
        console.log('YES');
    } else {
        console.log('NO');
    }
}

let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;

	var n = inputReader.readLine();
	var a = [0, 0, 0];
	for (var i = 0; i < n; i++) {
	  var x = inputReader.readLine().split(" ");
	  for (var j = 0; j < a.length; j++) a[j] += parseInt(x[0]);
	}
	console.log(a.join("") == "000" ? "YES" : "NO");

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readLine(){
		return _inputLines[_lineNumber++];
	}

	return {
		readLine,
	}
}

let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;

	var n = inputReader.readLine();
	var a = [0, 0, 0];
	for (var i = 0; i < n; i++) {
	  var x = inputReader.readLine().split(" ");
	  for (var j = 0; j < a.length; j++) a[j] += parseInt(x[j]);
	}
	console.log(a.join("") == "000" ? "YES" : "NO");

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readLine(){
		return _inputLines[_lineNumber++];
	}

	return {
		readLine,
	}
}

const readline = require('readline');

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

var count = 0;
var test;
var x = 0, y = 0, z = 0;

rl.on('line', (data) => {

    if(count!=0) {
        data = data .trim();

        var splitted = data.split(" ");
        var len = splitted.length;

        x= x + parseInt(splitted[0]);
        y= y + parseInt(splitted[1]);
        z= z + parseInt(splitted[2]);

        if(count===test){
            if(x===0 && y===0 && z===0) {
                console.log("YES");
            }else {
                console.log("NO");
            }
        }
    }else {
        data = data.trim();
        test = parseInt(data);
        x=0, y=0, z=0;
    }
    ++count;
});

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

process.stdin.on("end", (_) => {
  inputString = inputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function readLine() {
  return inputString[currentLine++];
}

/******** Main function*************/

function main() {
  var n = +readLine();
  var arr = [];

  for (var i = 0; i < n; i++) {
    var line = readLine().split(" ").map(Number);
    arr.push(line);
  }

  var sum1 = 0,
    sum2 = 0,
    sum3 = 0;
  for (var i = 0; i < n; i++) {
    arr[i].map((item, index) => {
      if (index == 0) {
        sum1 += item;
      } else if (index == 1) {
        sum2 += item;
      } else if (index == 2) {
        sum3 += item;
      }
    });
  }

  if (sum1 === 0 && sum2 === 0 && sum3 === 0) {
    console.log("YES");
  } else {
    console.log("NO");
  }
}

let fs = require("fs");

let txt = fs.readFileSync(0, "utf-8").split("\r\n").filter(data => {
    return data.length > 0
});
// txt.shift();
for (let index = 0; index < txt.length; index ++) {
   if(!isNaN(txt[index]*1)){
       let tab=[];
       for (let i = index+1; i < index+txt[index]*1+1; i++) {
           tab.push(...txt[i].split(" ").map(data=>{return data*1}))

       }
       doit(tab)
   }
}

function doit(tab) {
    let x=0,y=0,z=0
    tab.forEach((data,index) => {
        if(index%3==0){
            x+=data
        }else if(index%3==1){
            y+=data;
        }else{
            z+=data;
        }
    });
    if(x==0 && y==0 && z==0){
        console.log("YES");
    }else{
        console.log("NO");
    }

}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  const n = parseInt(readLine());
  let vectors = [];
  for (let i = 1; i < n + 1; i++) {
    let v = readLine()
      .split(" ")
      .map((value) => parseInt(value));
    vectors.push(v);
  }
  let sum = [0, 0, 0];
  for (let i = 0; i < vectors.length; i++) {
    const vector = vectors[i];
    for (let j = 0; j < vector.length; j++) {
      sum[j] = sum[j] + vectors[i][j];
    }
  }
  let result = sum.every((n) => n === 0);
  result = result ? "YES" : "NO";
  console.log(result);
}

var n = parseInt(readline(), 10), forceX = 0, forceY = 0, forceZ = 0, points = [];

for(var i=0; i<n; i++) {
    points.push(readline().split(' ').map(el => parseInt(el, 10)));
    forceX += points[i][0];
    forceY += points[i][1];
    forceZ += points[i][2];
}

print((forceX === 0 && forceY === 0 && forceZ === 0) ? 'YES' : 'NO');

var n = readline();

var powers = {
    x: 0,
    y: 0,
    z: 0
};

for(var i = 0; i < n; i++){
    var arr = readline().split(' ');
    powers.x += Number(arr[0]);
    powers.y += Number(arr[1]);
    powers.z += Number(arr[2]);
}

if ( powers.x == 0 && powers.y == 0 && powers.z == 0 ) {
    print('YES');
} else {
    print('NO');
}

var n = parseInt(readline());
var matrix = [];

while(n--)
	matrix.push(readline().split(" ").map(function convert(value) {return +value; }));

vectorSum = matrix.reduce(function(vectorSum, curForse) {
	vectorSum[0] += curForse[0];
	vectorSum[1] += curForse[1];
	vectorSum[2] += curForse[2];
	return vectorSum;
}, [0, 0, 0]);

print((vectorSum[0] === 0 && vectorSum[1] === 0 && vectorSum[2] === 0) ? 'YES' : 'NO');

  var n = readline();
    var a = [0,0,0];
  for(var k=0; k <n; k++){
    var forces = readline().split(' ');
    for(var j=0; j< forces.length; j++){
    a[j] += parseInt(forces[j]);
  }
  }

var end = (a[0] === 0 && a[1] === 0 && a[2] === 0) ? 'YES' : 'NO';

print(end);

var vectorsCount = parseInt(readline());
var point = {
    x: 0,
    y: 0,
    z: 0
}

for (var i = 0; i < vectorsCount; i++) {
    var vector = readline().split(" ").map(x => parseInt(x));
    point.x += vector[0];
    point.y += vector[1];
    point.z += vector[2];
}

print(point.x === 0 && point.y === 0 && point.z === 0 ? "YES" : "NO");

(function main() {

    var count = parseInt(readline());

    var a = 0,
        b = 0,
        c = 0;

    for ( var i = 0; i < count; i++ ) {

        var vec = readline().trim().split(' ').map(Number);

        a += vec[0];
        b += vec[1];
        c += vec[2];
    }

    if ( (a === 0) && (b === 0) && (c === 0) ) {
        print("YES");
    } else {
        print("NO");
    }

    return 0;
})();

var n = Number(readline());

var count = 0;
var v = [0, 0, 0];

while (n > 0) {
    var s = readline().split(' ').map(function(each) {return Number(each);});
    v[0] += s[0];
    v[1] += s[1];
    v[2] += s[2];

    --n;
}

if (v[0] === 0 && v[1] === 0 && v[2] === 0) {
    print("YES");
} else {
    print("NO");
}

function InputReader() {
    this.inputTokens = [];
    this.inputIndex = -1;
    this.nTokens = 0;

    this.readLine = function() {
        this.inputTokens = readline().split(" ");
        this.nTokens = this.inputTokens.length;
        this.inputIndex = 0;
    }

    this.next = function() {
        if ((this.nTokens == 0) || (this.inputIndex == this.nTokens)) {
            this.readLine();
        }
        var res = this.inputTokens[this.inputIndex];
        this.inputIndex++;
        return res;
    }

    this.nextInt = function() {
        return parseInt(this.next());
    }

    this.nextFloat = function() {
        return parseFloat(this.next());
    }

    this.nextChar = function() {
        return this.next().charAt(0);
    }
}

var inp = new InputReader();
var n = inp.nextInt();
var x = 0;
var y = 0;
var z = 0;
for (var i = 0; i < n; i++) {
    var xi = inp.nextInt();
    var yi = inp.nextInt();
    var zi = inp.nextInt();
    x += xi;
    y += yi;
    z += zi;
}
if ((x == 0) && (y == 0) && (z == 0)) {
    write("YES\n");
}
else {
    write("NO\n");
}

no = readline();
var vector;
var x = 0;
var y = 0;
var z = 0;
for (var i = 0; i < no; i++) {
         vector = readline().split(' ');
         x += parseInt(vector[0]);
         y += parseInt(vector[1]);
         z += parseInt(vector[2]);
}
if(!x && !y && !z)
         write("YES\n");
else
         write("NO\n");

var n = +readline();
var x = 0;
var y = 0;
var z = 0;
for (var i=0; i<n; i++){
	var p = readline().split(' ').map(Number);
	x += p[0];
	y += p[1];
	z += p[2];
}
if (x==0 && y==0 && z==0) print ('YES');
else print ('NO');

var n3 = readline()
var n = readline().split(" ").map(function(x){return parseInt(x)})
res = n

function sum(a,b) {
    a[0] = a[0] + b[0]
    a[1] = a[1] + b[1]
    a[2] = a[2] + b[2]
    return a
}

for(var i = 0; i < n3 - 1; i++) {
    var n1 = readline().split(" ").map(function(x){return parseInt(x)});
    res = sum(n,n1)
}

(res[0]==0&&res[1]==0&&res[2]==0)?res = "YES":res = "NO"

print(res)

var n = parseInt(readline());

var x = 0, y = 0, z = 0;

for (var i = 0; i < n; i++) {

    var numbers = readline().split(" ");

    x += parseInt(numbers[0]);
    y += parseInt(numbers[1]);
    z += parseInt(numbers[2]);
}

print((x === 0 && y === 0 && z === 0) ? 'YES' : 'NO');

var inp = parseInt(readline());
var x = 0;var y = 0;var z = 0;

for(var i=0;i<inp;i++)
{
var noop = readline().split(" ");

x+=(+noop[0]);z+=(+noop[1]);y+=(+noop[2]);
}

if((x===0)&&(y===0)&&(z===0)){print("YES")}
	else{print("NO")}

var x = readline();

var xsum = 0;
var ysum = 0;
var zsum = 0;

for(var i = 0; i < parseInt(x); i++) {
    var numbers = readline().split(" ").map(function (x) {return parseInt(x);});
    xsum += numbers[0];
    ysum += numbers[1];
    zsum += numbers[2];
}

if(xsum == 0 && ysum == 0 && zsum == 0) {
    print("YES");
} else {
    print("NO");
}

n = readline();
var sum1 = 0;
var sum2 = 0;
var sum3 = 0;
while(n--){
	k = readline().split(' ')
   sum1  =  sum1 +  parseInt(k[0]);
   sum2  =  sum2 +  parseInt(k[1]);
   sum3  =  sum3 +  parseInt(k[2]);
}
if (sum1 == 0 && sum2 == 0 && sum3 == 0) { print("YES") }
else{ print("NO")}

var n = readline();
var vector = [];
var sumX = 0,
  sumY = 0,
  sumZ = 0;

for (i = 0; i < n; i++) {
  vector.push(readline().split(" "));
  sumX += +vector[i][0];
  sumY += +vector[i][1];
  sumZ += +vector[i][2];
}

if (sumX === 0 && sumY === 0 && sumZ === 0) {
  print("YES");
} else {
  print("NO");
}

n = readline();

var sumX = 0, sumY = 0, sumZ = 0;

for (var i = 0; i < n; i++) {
	vect = readline().split(' ').map(Number);

	sumX = sumX + vect[0];
	sumY = sumY + vect[1];
	sumZ = sumZ + vect[2];
};

if (sumX == 0 && sumY == 0 && sumZ == 0) {
	print('YES');
} else {
	print('NO');
};

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline

var s=parseInt(readline().split(' ')[0]);
var arr=[];
for(var i=0;i<s;i++){
    arr[i]=readline().split(' ').map(i=>parseInt(i));
}
//console.log(arr)
var result="YES";
var f=0;
var se=0;
var th=0;
for(var i=0;i<s;i++){
    f+=arr[i][0]
    se+=arr[i][1];
    th+=arr[i][2];
}
if(f!=0||se!=0||th!=0){
   result="NO"
}
print(result)

var n=+readline();
var a=[];
while(n--){
	a.push(readline().split(' ').map(function(v){return +v;}));
}
var ans = a.reduce(function(ret, v){
	return ret.map(function(vv, i){
		return vv+v[i];
	});
}, [0,0,0]);
print(ans[0]==0&&ans[1]==0&&ans[2]==0?'YES':'NO');

var n = +readline();
var a = [0,0,0];
for(var i=0; i<n; i++) {
    var x = readline().split(' ');
    for(var j=0; j< a.length; j++) a[j] += +x[0];
}
print(a.join('') == '000' ? "YES" : "NO");

var n = parseInt(readline());
var a = [0,0,0];
for(var i=0; i<n; i++) {
    var x = readline().split(' ');
    for(var j=0; j< a.length; j++) a[j] += parseInt(x[0]);
}
print(a.join('') == '000' ? "YES" : "NO");

var number = readline();
var temp1 = 0;
var temp2 = 0;
var temp3 = 0;

for(var i = 0, counter= parseInt(number); i<counter ;i ++){
    var temp = readline().split(" ");
    temp1 += +temp[0];
    temp2 += +temp[1];
    temp3 += +temp[2];
}

if( (temp1 || temp2 || temp3) !== 0){
    print("NO");
}else{
    print("YES");
}

var n = parseInt(readline());
var inp;
var x = 0, y = 0, z = 0;

for(var i=0; i<n; i++)
{
  inp = readline().split(" ");
  x += parseInt(inp[0]);
  y += parseInt(inp[1]);
  z += parseInt(inp[2]);
}

if(x == 0 && y == 0 && z == 0) print('YES');
else print('NO');

var linhas = parseInt(readline(), 10);
var i=0;
var linha_aux = "";
var x = 0;
var y = 0;
var z = 0;
while(i<linhas){
    linha_aux = readline();
    linha_aux = linha_aux.split(" ");
    x += parseInt(linha_aux[0],10);
    y += parseInt(linha_aux[1],10);
    z += parseInt(linha_aux[2],10);

   // print(linha_aux);
    i++;
}
print(x===0 && y==0 && z==0?"YES":"NO")

a = readline()
x = 0
y = 0
z = 0

for( i = 0; i < a ; i++) {
    n = readline().split(' ');
    x = x + parseInt(n[0])
    y = y + parseInt(n[1])
    z = z + parseInt(n[2])

}
if ( x === 0  && y === 0 && z === 0) {
    print('YES');
}
else {
    print('NO')
}

var numberOfLine = Number(readline())

var x = 0
var y = 0
var z = 0

for(var i = 0; i < numberOfLine; i++) {
  var line = readline().split(' ').map(Number)

  x += line[0]
  y += line[1]
  z += line[2]
}

if (x === 0 && y === 0 && z === 0) {
  print('YES')
} else {
  print('NO')
}

var n = readline();
var x = 0;
var y = 0;
var z = 0;
for(var i=0; i < n; i++){
    var vector = readline().split(' ');
    x += parseInt(vector[0]);
    y += parseInt(vector[1]);
    z += parseInt(vector[2]);
}

if(x==0 &&  y==0 && z == 0){
    print('YES');
}else {
    print('NO');
}

'use strict'
let input = readline()
let i = 1
let x = 0
let y = 0
let z = 0
while(i <= input){
    let data = readline().split(' ').map(Number);
    x += data[0]
    y += data[1]
    z += data[2]
    i++
}
(x == 0 && y == 0 && z == 0) ? print("YES") : print("NO")

var numOfLines = parseInt(readline()),
        sum1 = 0,
        sum2 = 0,
        sum3 = 0;
      for (var i = 0; i < numOfLines; i++) {
        var arr = readline().split(" ").map((el) => parseInt(el));
        sum1 += arr[0];
        sum2 += arr[1];
        sum3 += arr[2];
      }
      if (sum1 === 0 && sum2 === 0 && sum3 === 0) {
        print("YES");
      } else {
        print("NO");
      }

var numOfLines = parseInt(readline()),
        sum1 = 0,
        sum2 = 0,
        sum3 = 0;
      for (var i = 0; i < numOfLines; i++) {
        var arr = readline().split(" ");
        arr = arr.map((el) => parseInt(el));
        sum1 += arr[0];
        sum2 += arr[1];
        sum3 += arr[2];
      }
      if (sum1 === 0 && sum2 === 0 && sum3 === 0) {
        print("YES");
      } else {
        print("NO");
      }

var n = parseInt(readline());
var s1 = 0, s2 = 0, s3 = 0;
for (var i = 0; i < n; i++)
{
    var str = readline().split(' ');
    s1 += parseInt(str[0]);
    s2 += parseInt(str[1]);
    s3 += parseInt(str[2]);
}
if (s1 === 0 && s2 === 0 && s3 === 0)
    print('YES');
else
    print('NO');

'use strict';
let n = parseInt(readline()),
    totalX = 0,
    totalY = 0,
    totalZ = 0;

for(let i = 0; i<n; i++) {
    let vector = readline().split(' ').map(function(value){
        return parseInt(value);
    })

    totalX += vector[0];
    totalY += vector[1];
    totalZ += vector[2];
}

if(totalX === 0 && totalY === 0 && totalZ === 0) {
    write('YES');
} else {
    write('NO');
}

var size=readline();
// var size =prompt();
var x=0,y=0,z=0;
for(var i=0; i<size;i++){
    var matrix=readline().split(" ");
    // var matrix=prompt().split(" ");
    x+=parseInt(matrix[0]);
    y+=parseInt(matrix[1]);
    z+=parseInt(matrix[2]);
}
if(x==0 && y==0 && z==0){
    print("YES");
    // console.log("YES");
}
else{
    print("NO");
    // console.log("NO");
}

var n = +readline();
var res = [0,0,0];

	for (var i=0; i<n; i++){

		var str = readline().split(" ");
		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			res[j] += Number(str[j]);
		}

	}
	res.join("")=== "000"? print("YES"):print("NO");

var n = parseInt(readline());
var coordonate = [];
var x = [], y = [], z = [];
var sumX = 0, sumY = 0, sumZ = 0;

for (var i = 0; i < n; i++) {
	coordonate = readline().split(' ');

	x.push(parseInt(coordonate[0]));
	y.push(parseInt(coordonate[1]));
	z.push(parseInt(coordonate[2]));
	sumX += x[i];
	sumY += y[i];
	sumZ += z[i];
}

if (sumX == 0 && sumY == 0 && sumZ ==0) {
	print("YES");
} else {
	print("NO");
}

var n = parseInt(readline());
var x = 0, y = 0, z = 0;

for (var i = 0; i < n; i++) {
	var coordonate = readline().split(' ');

	x += parseInt(coordonate[0]);
	y += parseInt(coordonate[1])
	z += parseInt(coordonate[2]);
}

if (x == 0 && y == 0 && z ==0) {
	print("YES");
} else {
	print("NO");
}

var n = parseInt(readline());
var xi = 0;
var yi = 0;
var zi = 0;
var f = function(num){ return parseInt(num);};
for(var i = 0; i < n; i++){
    var line = readline().split(' ').map(f);
    xi += line[0];
    yi += line[1];
    zi += line[2];
}
print(xi === 0 && yi === 0 && zi === 0 ? 'YES' : 'NO');

var c = readline();
var out = 0;
while (c--) {
    out += +readline().split(' ')[0];
}
print(out !== 0 ? "NO" : "YES");

//var print = require('./print');
//var readline = require('./readline');
var n = parseInt(readline());
var dx = 0, dy = 0, dz = 0;
for(var i=0;i<n;i++){
  var d = readline().split(' ');
  dx += parseInt(d[0]);
  dy += parseInt(d[1]);
  dz += parseInt(d[2]);
}
if (dx==0 && dy==0 && dz===0){
  print('YES');
}
else{
  print('NO');
}

var n = Number(readline());

var s, x = 0, y = 0, z = 0;
for (var i = 0; i < n; i++) {
    s = readline().split(' ');
    x+= Number(s[0]);
    y+= Number(s[1]);
    z+= Number(s[2]);

}

if (x === 0 && y === 0 && z === 0) {
    print('YES');
}
else {
    print('NO');
}

var n = +readline();
var a = [0,0,0];
for(var i=0; i<n; i++) {
    var x = readline().split(' ');
    for(var j=0; j< a.length; j++) a[j] += +x[0];
}
print(a.join('') == '000' ? "YES" : "NO");

var n = parseInt(readline());
var x = 0, y = 0; z = 0;
for (var i = 0; i < n; i++) {
	var l = readline().split(" ").map(function(x) { return parseInt(x); });
	x += l[0]; y += l[1]; z += l[2];
}
if (x == 0 && y== 0 && z == 0) {
	print ('YES');
} else {
	print ('NO');
}

var xCoordinate = 0;
var yCoordinate = 0;
var zCoordinate = 0;
var resultPower = [];

for (var counter = +readline(); counter >= 1;--counter)
    {
         resultPower = readline().split(' ');
         xCoordinate += +resultPower[0];
         yCoordinate += +resultPower[1];
        zCoordinate += +resultPower[2];
    }
if (isZeroCoordinate(xCoordinate, yCoordinate, zCoordinate))
    {
       print("YES");
    }
else
   {
      print("NO");
   }

function isZeroCoordinate(x , y, z)
    {
          return x === 0 && y === 0 && z === 0;
    }

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  var T = readline();

  let vectorX = readline()
    .split(' ')
    .map((int) => parseInt(int));
  let vectorY = readline()
    .split(' ')
    .map((int) => parseInt(int));
  let vectorZ = readline()
    .split(' ')
    .map((int) => parseInt(int));

  let sum = 0;

  for (let i = 0; i < 3; i++) {
    sum += vectorX[i] + vectorY[i] + vectorZ[i];
  }

  if (sum === 0) {
    console.log('YES');
  } else {
    console.log('NO');
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  var T = readline();

  let matrix = [];

  while (T-- > 0) {
    let vector = readline()
      .split(' ')
      .map((int) => parseInt(int));

    matrix.push(vector);
  }

  let sum = 0;

  for (let i = 0; i < matrix.length; i++) {
    let vector = matrix[i];
    sum += vector[0] + vector[1] + vector[3];
  }

  if (sum === 0) {
    console.log('YES');
  } else {
    console.log('NO');
  }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  var T = readline();

  let matrix = [];

  while (T-- > 0) {
    let vector = readline()
      .split(' ')
      .map((int) => parseInt(int));

    matrix.push(vector);
  }

  let sum = 0;

  for (let i = 0; i < matrix.length; i++) {
    let vector = matrix[i];

    for (let j = 0; j < 3; j++) {
      sum += vector[j] + vector[j] + vector[j];
    }
  }

  if (sum === 0) {
    console.log('YES');
  } else {
    console.log('NO');
  }
}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStd) => {
  inputString += inputStd;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let t = +readLine();
  const data = [];
  while (t--) {
    const row = readLine()
      .split(" ")
      .map((n) => parseInt(n));
    data.push(row);
  }
  const len = data.length;

  for (let col = 0; col < len; col++) {
    let sum = 0;
    for (let row = 0; row < len; row++) {
      sum += data[row][col];
    }
    if (sum !== 0) {
      console.log("NO");
      return;
    }
  }
  console.log("YES");
}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStd) => {
  inputString += inputStd;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let t = +readLine();
  const data = [];
  while (t--) {
    const row = readLine()
      .split(" ")
      .map((n) => parseInt(n));
    data.push(row);
  }

  let sum = 0;
  for (let row = 0; row < data.length; row++) {
    for (let col = 0; col < 3; col++) {
      sum += data[row][col];
    }
  }
  sum === 0 ? console.log("YES") : console.log("NO");
}

let readline = require('readline');
let rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
	terminal: false
});
input = [];
rl.on('line', function(line) {
	input.push(line);
	if (input.length === input[0] * 1 + 1) {
		youngPhysicist(input);
		rl.close();
	}
});

//M N
let youngPhysicist = (input) => {
	input.shift();
	let reducer = (acc, curr) => acc * 1 + curr * 1;
	let result = input
		.map((el) => {
			return el.split(' ').reduce(reducer);
		})
		.reduce(reducer);
	console.log(result === 0 ? 'YES' : 'NO');
};

const readline = require('readline')

let inputs = []

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})
rl.on('close', () => {
    let n = parseInt(inputs[0]);
    let forces = []

    for (let i = 1; i < n + 1; i++) {
        const coordinate = inputs[i].split(' ').map(num => parseInt(num))
        forces.push(coordinate)
    }

    const xSum = forces.map(elem => elem[0]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    const ySum = forces.map(elem => elem[1]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    const zSum = forces.map(elem => elem[1]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    if (xSum != 0 && ySum != 0 && zSum != 0)
        return console.log('NO')
    else
        return console.log("YES")

})

const readline = require('readline')

let inputs = []

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})
rl.on('close', () => {
    let n = parseInt(inputs[0]);
    let forces = []

    for (let i = 1; i < n + 1; i++) {
        const coordinate = inputs[i].split(' ').map(num => parseInt(num))
        forces.push(coordinate)
    }

    const xSum = forces.map(elem => elem[0]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    const ySum = forces.map(elem => elem[1]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    const zSum = forces.map(elem => elem[1]).reduce((accum, next) => {
        return accum += next;
    }, 0);

    if (xSum + ySum + zSum != 0)
        return console.log('NO')
    else
        return console.log("YES")

})

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function main() {
	let n = readLine() >> 0,
		m = n;
	const arr = [];

	while (n--) {
		const vector = readLine()
			.split(' ')
			.map(x => x >> 0);
		arr.push(vector);
	}

	let nonZero = false,
		sum = 0;

	for (let i = 0; i < m; i++) {
		sum = 0;
		for (let j = 0; j < 3; j++) {
			sum += arr[j][i];
		}

		if (sum !== 0) {
			nonZero = true;
			break;
		}
	}

	nonZero ? console.log('NO') : console.log('YES');
}

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function main() {
	let n = readLine() >> 0;
	const arr = [];

	while (n--) {
		const vector = readLine()
			.split(' ')
			.map(x => x >> 0);
		arr.push(vector);
	}

	let nonZero = false,
		sum = 0;

	for (let i = 0; i < 3; i++) {
		sum = 0;
		for (let j = 0; j < 3; j++) {
			sum += arr[j][i];
		}

		if (sum !== 0) {
			nonZero = true;
			break;
		}
	}

	nonZero ? console.log('NO') : console.log('YES');
}

process.stdin.resume();
console.log(process);
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}

function main() {
    const n = +readLine();
    let AllX = [];
    let AllY = []; // [2, -1,-1]
    let AllZ = [];

    for (let i = 0; i < n; i++) {
        const numsArray = readLine().split(' ').map(Number);
        const [x, y, z] = numsArray;
        AllX.push(x);
        AllY.push(y);
        AllZ.push(z);
    }
    let sumX = AllX.reduce((a, b) => {
        return a + b;
    }, 0);
    let sumY = AllY.reduce((a, b) => {
        return a + b;
    }, 0);
    let sumZ = AllZ.reduce((a, b) => {
        return a + b;
    }, 0);
    if (sumX === 0 && sumY === 0 && sumZ === 0) {
        console.log('YES');
    } else {
        console.log('NO');
    }
}

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

process.stdin.on("end", (_) => {
  inputString = inputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function readLine() {
  return inputString[currentLine++];
}

/******** Main function*************/

function main() {
  var n = +readLine();
  var arr = [];

  for (var i = 0; i < n; i++) {
    var line = readLine().split(" ").map(Number);
    arr.push(...line);
  }

  var sum = arr.reduce((acc, item) => {
    return (acc += item);
  }, 0);

  if (sum === 0) {
    console.log("YES");
  } else {
    console.log("NO");
  }
}

let fs = require("fs");

let txt = fs.readFileSync(0, "utf-8").split("\r\n").filter(data => {
    return data.length > 0;
});
// txt.shift();
for (let index = 0; index < txt.length; index ++) {
   if(!isNaN(txt[index]*1)){
       let tab=[];
       for (let i = index+1; i < index+txt[index]*1+1; i++) {
           tab.push(...txt[i].split(" ").map(data=>{return data*1}));

       }
       doit(tab);
   }
}

function doit(tab) {
    let score=0;
    tab.forEach(element => {
        score+=element;
    });
    if(score===0){
        console.log("YES");
    }else{
        console.log("NO");
    }

}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  const n = parseInt(readLine());
  let vectors = [];
  for (let i = 1; i < n + 1; i++) {
    let v = readLine()
      .split(" ")
      .map((value) => parseInt(value))
      .reduce((a, b) => a + b, 0);
    vectors.push(v);
  }
  let sum = vectors.reduce((a, b) => a + b, 0);
  let result = sum === 0 ? "YES" : "NO";
  console.log(result);
}

var n = parseInt(readline(), 10), force = 0, points = '', tempSum = 0;

for(var i=1; i<=n; i++) {
    points = readline().split(' ').map(el => parseInt(el, 10));
    tempSum = points.reduce((a,b) => a+b);
    if(tempSum !== 0) {
        force += tempSum;
    } else {
        force = -1;
        break;
    }
}

print((force === 0) ? 'YES' : 'NO');

var n = parseInt(readline(), 10), force = 0, points = '';

for(var i=1; i<=n; i++) {
    points = readline().split(' ').map(el => parseInt(el, 10));
    force += points.reduce((a,b) => a+b);
}

print((force === 0) ? 'YES' : 'NO');

var n = readline();

var powers = {
    x: 0,
    y: 0,
    z: 0
};

for(var i = 0; i < n; i++){
    var arr = readline().split(' ');
    powers.x += Number(arr[0]);
    powers.y += Number(arr[1]);
    powers.z += Number(arr[2]);
}

if (powers.x + powers.y + powers.z > 0) {
    print('NO');
} else {
    print('YES');
}

var n = readline();

var powers = {
    x: 0,
    y: 0,
    z: 0
};

for(var i = 0; i < n; i++){
    var arr = readline().split(' ');
    powers.x += Number(arr[0]);
    powers.y += Number(arr[1]);
    powers.z += Number(arr[2]);
}

if ( powers.x && powers.y && powers.z ) {
    print('NO');
} else {
    print('YES');
}

  var n = readline();
    var a = [0,0,0];
  for(var k=0; k <n; k++){
    var forces = readline().split(' ');
    for(var j=0; j< forces.length; j++){
    a[j] += forces[j];
  }
  }

var end = (a[0] === 0 && a[1] === 0 && a[2] === 0) ? 'YES' : 'NO';

print(end);

  var n = readline();
    var result = 0;
  for(var k=0; k <n; k++){
    var forces = readline().split(' ');
    for(var j=0; j< forces[k].length; j++){
    result += forces[k][j];
  }
  }

var end = result === 0 ? 'YES' : 'NO';

print(end);

var vectorsCount = parseInt(readline());
var point = {
    x: 0,
    y: 0,
    z: 0
}

for (var i = 0; i < vectorsCount; i++) {
    var vector = readline().split(" ").map(x => parseInt(x));
    point.x += vector[0];
    point.y += vector[1];
    point.z += vector[2];
}

print(point.x + point.y + point.z === 0 ? "YES" : "NO");

(function main() {

    var count = parseInt(readline());

    var a = 0,
        b = 0,
        c = 0;

    for ( var i = 0; i < count; i++ ) {

        var vec = readline().trim().split(' ').map(Number);

        a += vec[0];
        b += vec[1];
        c += vec[2];
    }

    if ( a + b + c == 0 ){
        print("YES");
    } else {
        print("NO");
    }

    return 0;
})();

no = readline();
var vector;
var x = 0;
var y = 0;
var z = 0;
for (var i = 0; i < no; i++) {
         vector = readline().split(' ');
         x += vector[0];
         y += vector[1];
         z += vector[2];
}
if(!x && !y && !z)
         write("YES\n");
else
         write("NO\n");

var n = readline()
var n = readline().split(" ").map(function(x){return parseInt(x)})
var n1 = readline().split(" ").map(function(x){return parseInt(x)})
var n2 = readline().split(" ").map(function(x){return parseInt(x)})

var res = ((n[0]+n1[0]+n2[0])+(n[1]+n1[1]+n2[1])+(n[2]+n1[2]+n2[2]));

(res == 0)?res = "YES":res = "NO"

print(res)

var n3 = readline()
var n = readline().split(" ").map(function(x){return parseInt(x)})
res = n

function sum(a,b) {
    a[0] = a[0] + b[0]
    a[1] = a[1] + b[1]
    a[2] = a[2] + b[2]
    return a
}

for(var i = 0; i < n3 - 1; i++) {
    var n1 = readline().split(" ").map(function(x){return parseInt(x)});
    res = sum(n,n1)
}
res = res.reduce((a, b) => a + b, 0);

(res == 0)?res = "YES":res = "NO"

print(res)

var n = readline()
var sum = [[], [], []]

for(var i = 0; i < n; i++) {
    n = readline().split(" ").map(function(x){return parseInt(x)})
    sum[0].push(n[0])
    sum[1].push(n[1])
    sum[2].push(n[2])
}

for(elem of sum) {
    elem = elem.reduce((a, b) => a + b, 0)
    if (elem==0) {
        res = "YES"
    }else {
        res = "NO"
        break;
    }
}

print(res)

var n3 = readline()
var n = readline().split(" ").map(function(x){return parseInt(x)})
res = n

function sum(a,b) {
    a[0] = a[0] + b[0]
    a[1] = a[1] + b[1]
    a[2] = a[2] + b[2]
    return a
}

for(var i = 0; i < n3 - 1; i++) {
    var n1 = readline().split(" ").map(function(x){return parseInt(x)});
    res = sum(n,n1)
    print(res)
}

(res[0]==0&&res[1]==0&&res[2]==0)?res = "YES":res = "NO"

print(res)

// One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution. Otherwise, the friends won't write the problem's solution.

// This contest offers n problems to the participants. For each problem we know, which friend is sure about the solution. Help the friends find the number of problems for which they will write a solution.
// Input

// The first input line contains a single integer n (1 ≤ n ≤ 1000) — the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Vasya's view on the solution, the third number shows Tonya's view. The numbers on the lines are separated by spaces.
// Output

// Print a single integer — the number of problems the friends will implement on the contest.

var n = readline()

var vectors = []
for (i=0; i<n; i++){
    vectors = vectors.concat(readline().split(' '))
}

var sum = 0
var len = vectors.length
for (i=0; i<len; i++){
    sum = sum + +vectors[i]
}

if (sum === 0) {
    print("YES")
}else {
    print("NO")
}

// A guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his favorite hockey team. And, as the boy loves hockey very much, even more than physics, he forgot to do the homework. Specifically, he forgot to complete his physics tasks. Next day the teacher got very angry at Vasya and decided to teach him a lesson. He gave the lazy student a seemingly easy task: You are given an idle body in space and the forces that affect it. The body can be considered as a material point with coordinates (0; 0; 0).

// Vasya had only to answer whether it is in equilibrium. "Piece of cake" — thought Vasya, we need only to check if the sum of all vectors is equal to 0.

//So, Vasya began to solve the problem. But later it turned out that there can be lots and lots of these forces, and Vasya can not cope without your help. Help him. Write a program that determines whether a body is idle or is moving by the given vectors of forces.

// Input
// The first line contains a positive integer n (1 ≤ n ≤ 100), then follow n lines containing three integers each: the xi coordinate, the yi coordinate and the zi coordinate of the force vector, applied to the body ( - 100 ≤ xi, yi, zi ≤ 100).

// Output
// Print the word "YES" if the body is in equilibrium, or the word "NO" if it is not.

var n = readline()

var vectors = []
for (i=0; i<n; i++){
    vectors = vectors.concat(readline().split(' '))
}

var sum = 0
var len = vectors.length
for (i=0; i<len; i++){
    sum = sum + +vectors[i]
}

if (sum === 0) {
    print("YES")
}else {
    print("NO")
}

// A guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his favorite hockey team. And, as the boy loves hockey very much, even more than physics, he forgot to do the homework. Specifically, he forgot to complete his physics tasks. Next day the teacher got very angry at Vasya and decided to teach him a lesson. He gave the lazy student a seemingly easy task: You are given an idle body in space and the forces that affect it. The body can be considered as a material point with coordinates (0; 0; 0).

// Vasya had only to answer whether it is in equilibrium. "Piece of cake" — thought Vasya, we need only to check if the sum of all vectors is equal to 0.

//So, Vasya began to solve the problem. But later it turned out that there can be lots and lots of these forces, and Vasya can not cope without your help. Help him. Write a program that determines whether a body is idle or is moving by the given vectors of forces.

// Input
// The first line contains a positive integer n (1 ≤ n ≤ 100), then follow n lines containing three integers each: the xi coordinate, the yi coordinate and the zi coordinate of the force vector, applied to the body ( - 100 ≤ xi, yi, zi ≤ 100).

// Output
// Print the word "YES" if the body is in equilibrium, or the word "NO" if it is not.

var n = readline()

var vec = []
for (i=0; i<n; i++){
    vec.push(readline().split(' '))
}

var sumJ = 0
var sumD = 0
var sumT = 0
for (i=0; i<n; i++) {
     sumJ += +vec[i][0];
     sumD += +vec[i][1];
     sumT += +vec[i][2]
}

if (sumJ === 0 && sumD === 0 && sumT === 0){
    print("YES")
}else {
    print("NO")
}

print(sumJ)

var x = readline();

var array = [];

for(var i = 0; i < parseInt(x); i++) {
    var numbers = readline().split(" ").map(function (x) {return parseInt(x);});
    var sum = 0;
    for(var j = 0; j < numbers.length; j++) {
        sum += numbers[j];
    }

    array.push(sum);
}

if(array[0] == 0 && array[1] == 0 && array[2] == 0) {
    print("YES");
} else {
    print("NO");
}

var x = readline();

var sum = 0;

for(var i = 0; i < parseInt(x); i++) {
    var numbers = readline().split(" ").map(function (x) {return parseInt(x);});

    for(var j = 0; j < numbers.length; j++) {
        sum += numbers[j];
    }
}

if(sum == 0) {
    print("YES")
} else {
    print("NO")
}

n = readline();
var sum = 0;
while(n--){
    sum = sum + parseInt(readline().split(' ').reduce((a, b) => parseInt(a) + parseInt(b)))
}
if (sum == 0) { print("YES") }
else{ print("NO")}

n = readline();
var sum1 = 0;
var sum2 = 0;
var sum3 = 0;
while(n--){
	k = readline().split(' ')
   sum1  =  sum1 +  k[0];
   sum2  =  sum2 +  k[1];
   sum3  =  sum3 +  k[2];
}
if (sum1 == 0 && sum2 == 0 && sum3 == 0) { print("YES") }
else{ print("NO")}

n = readline();
var sum1 = 0;
var sum2 = 0;
var sum3 = 0;
while(n--){
	k = readline().split(' ')
   sum1  =  sum1 +  k[0];
   sum2  =  sum1 +  k[1];
   sum3  =  sum1 +  k[2];
}
if (sum1 == 0 && sum2 == 0 && sum3 == 0) { print("YES") }
else{ print("NO")}

n = readline();

var sumX = 0, sumY = 0, sumZ = 0;

for (var i = 0; i < n; i++) {
	vect = readline().split(' ').map(Number);

	sumX = sumX + vect[0];
	sumY = sumY + vect[1];
	sumZ = sumZ + vect[2];
};

var sum = sumX + sumY + sumZ;

if (sum === 0) {
	print('YES');
} else {
	print('NO');
};

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline

var s=parseInt(readline().split(' ')[0]);
var arr=readline().split(' ').map(i=>parseInt(i));
var force1=readline().split(' ').map(i=>parseInt(i));
var force2=readline().split(' ').map(i=>parseInt(i));

var result="YES";
for(var i=0;i<arr.length;i++){
    var sum=arr[i]+force1[i]+force2[i];
    if(sum!==0){
       result="NO";
       break;
    }
}
print(result);

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline

var s=parseInt(readline().split(' ')[0]);
var arr=[];
for(var i=0;i<s;i++){
    arr[i]=readline().split(' ').map(i=>parseInt(i));
}
var result="YES";
for(var i=0;i<arr.length;i++){
    var sum=arr[i][0]+arr[i][1]+arr[i][2];
    if(sum!=0){
   result="NO"
    }
}
print(result)

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline

var s=parseInt(readline().split(' ')[0]);
var arr=[];
for(var i=0;i<s;i++){
    arr[i]=readline().split(' ').map(i=>parseInt(i));
}
//console.log(arr)
var result="YES";
var f=0;
var se=0;
var th=0;
for(var i=0;i<s;i++){
    f+=arr[i][0]
    se+=arr[i][1];
    th+=arr[i][2];
}
if(f+se+th!=0){
   result="NO"
}
print(result)

var n=+readline();
var a=[];
while(n--){
	a=a.concat(readline().split(' ').map(function(v){return +v;}));
}
var ans = a.reduce(function(ret, v){
	return ret+v;
}, 0);
print(ans===0?'YES':'NO');

var n=+readline();
var a=[];
while(n--){
	a.concat(readline().split(' ').map(function(v){return +v;}));
}
var ans = a.reduce(function(ret, v){
	return ret+v;
}, 0);
print(ans===0?'YES':'NO');

var n = parseInt(readline());
var a = [0,0,0];
for(var i=0; i<n; i++) {
    var x = readline().split('');
    for(var j=0; j< a.length; j++) a[j] += parseInt(x[0]);
}
print(a.join('') == '000' ? "YES" : "NO");

var number = readline();
var temp1 = 0;
var temp2 = 0;
var temp3 = 0;

for(var i = 0, counter= parseInt(number); i<counter ;i ++){
    var temp = readline().split(" ");
    temp1 += +temp[0];
    temp2 += +temp[1];
    temp3 += +temp[2];
}

if( (temp1 && temp2 && temp3) === 0){
    print("YES");
}else{
    print("NO");
}

var linhas = parseInt(readline(), 10);
var i=0;
var linha_aux = "";
var total = 0;
while(i<linhas){
    linha_aux = readline();
    linha_aux = linha_aux.split(" ");
    total += parseInt(linha_aux[0],10)+ parseInt(linha_aux[1],10)+ parseInt(linha_aux[2],10);
   // print(linha_aux);
    i++;
}
print(total===0?"YES":"NO")

'use strict'
let input = readline()
let i = 1
let diff = 0
while(i <= input){
    let data = readline().split(' ').map(Number);
    let d = data.reduce((acc,add) => {
      return acc+add;
    })
    if(diff == 0) diff = d
    else diff += d
    i++
}
diff == 0 ? print("YES") : print("NO")

      numOfLines = readline();
      numOfLines = parseInt(numOfLines);
        sum = 0;
        sumOfSum = 0;
      for ( i = 0; i < numOfLines; i++) {
        arr = readline().split(" ");

        arr = arr.map((el) => parseInt(el));
        arr = arr.map((el) => {
          sum += el;
        });
        sumOfSum += sum;
        sum = 0;
      }
      if (sumOfSum === 0) {
        print("YES");
      } else {
        print("NO");
      }

      numOfLines = readline();
      numOfLines = parseInt(numOfLines);
      isTrue = false;
        sum = 0;
        sumOfSum = 0;
      for ( i = 0; i < numOfLines; i++) {
        arr = readline().split(" ");

        arr = arr.map((el) => {
          sum += el;
        });
        sumOfSum += sum;
        sum = 0;
      }
      if (sumOfSum == 0) {
        print("YES");
      } else {
        print("NO");
      }

      numOfLines = readline();
      numOfLines = parseInt(numOfLines);
      isTrue = false;
        sum = 0;
        sumOfSum = 0;
      for ( i = 0; i < numOfLines; i++) {
        arr = readline().split(" ");

        arr = arr.map((el) => parseInt(el));
        arr = arr.map((el) => {
          sum += el;
        });
        sumOfSum += sum;
        sum = 0;
      }
      if (sumOfSum == 0) {
        print("YES");
      } else {
        print("NO");
      }

var n = parseInt(readline());
var s1 = 0, s2 = 0, s3 = 0;
for (var i = 0; i < n; i++)
{
    var str = readline().split(' ');
    s1 += str[0];
    s2 += str[1];
    s3 += str[2];
}
if (s1 === 0 && s2 === 0 && s3 === 0)
    print('YES');
else
    print('NO');

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[i] += +str[j];
			}
	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n  = readline();
var res = "0 0 0".split(" ");
var room = 0;
	for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(res)+Number(str);//+Number(res[1])+Number(str[1])+Number(res[2])+Number(str[2]);

	}
res===0? print("YES"):print("NO")

var n  = readline();
var res = [0,0,0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += +str[j];
			}
	}
//..console.log(res);
res==[0,0,0]? print("YES"):print("NO")

var n = readline();
var temp = 0;
var res = 0;

//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");

	for (var i=0; i<n; i++){
		var str = readline().split(" ");

		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;
	}
	+res==0? print("YES"):print("NO");

var n = +readline();

var temp = 0;
var res = [0,0,0];

	for (var i=0; i<n; i++){

		var str = readline().split(" ");
		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			res[j] += Number(str[j]);
		}

	}
	res===[0,0,0]? print("YES"):print("NO");

var n  = readline();
var res = [0, 0, 0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 //for (var j=0; j<1; j++){
			res[i] += +str[i];
		//	}
	}
//..console.log(res);
res==[0, 0, 0]? print("YES"):print("NO")

var n = +readline();

var temp = 0;
var res = [0,0,0];

	for (var i=0; i<n; i++){

		var str = readline().split(" ");
		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;

	}
	res===[0,0,0]? print("YES"):print("NO");

var n  = readline();
var res = "";
var room = 0;
	for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(res)+Number(str);//+Number(res[1])+Number(str[1])+Number(res[2])+Number(str[2]);

	}
res===0? print("YES"):print("NO")

var n  = readline();
var res = [0, 0, 0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] = +str[j];
			}
	}
//console.log(res);
res==[0, 0, 0]? print("YES"):print("NO")

var n  = readline();
var res = [0,0,0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += +str[0];
			}
	}
//console.log(res);
print(res==='000' ? "YES" : "NO");

var n  = readline();
var res = "0 0 0".split(" ");
var x = " ";
var room = 0;
	for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(res[0])+Number(str[0])+Number(res[1])+Number(str[1])+Number(res[2])+Number(str[2]);

	}
res===0? print("YES"):print("NO")

var n  = readline();
var res = "0 0 0".split(" ");
var room = 0;
	for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(res)+Number(str)+Number(res[1])+Number(str[1])+Number(res[2])+Number(str[2]);

	}
res==0? print("YES"):print("NO")

var n  = readline();
var res = [0, 0, 0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<2; j++){
			res[j] += +str[j];
			}
	}
//console.log(res);
res==[0, 0, 0]? print("YES"):print("NO")

var n  = readline();
var res = [0,0,0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[i] += +str[j];
			}
	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n = +readline();
var temp = 0;
var res = 0;

	for (var i=0; i<n; i++){

		var str = readline().split(" ");
		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;

	}
	res===0? print("YES"):print("NO");

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(res[0])+Number(str[0])+Number(res[1])+Number(str[1])+Number(str[2])+Number(res[2]);

	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n = readline();
var temp = 0;
var res = 0;

//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");

	for (var i=0; i<1; i++){
		var str = readline().split(" ");

		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;
	}
	+res==0? print("YES"):print("NO");

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[i] += str[j];
			}
	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[i] += +str[j];
			}
	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n = readline();
var temp = 0;
var res = 0;

//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");

	for (var i=0; i<n; i++){
		var str = readline().split(" ");

		for (var j=0; j<9; j++){
		   	temp += Number(str[j]);
		}
		res+= temp;
	}
	res==0? print("YES"):print("NO");

var n = readline();
var temp = 0;
var res = 0;
	for (var i=0; i<n; i++){
		var str = readline().split(" ");

		for (var j=0; j<3; j++){
		   	temp += Number(str[j]);
		}
		res+= temp;
	}
	res==0?print("YES"):print("NO");

var n  = readline();
var res = [0,0,0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += Number(str[j]);
			}
	}
//console.log(res);
print(res.join('') == '000' ? "YES" : "NO");

var n = readline();
var temp = 0;
var res = 0;

//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");

	for (var i=0; i<n; i++){
		var str = readline().split(" ");

		for (var j=0; j<4; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;
	}
	+res==0? print("YES"):print("NO");

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(res[0])+Number(str[0])+Number(res[1])+Number(str[1])+Number(res[2])+Number(str[2]);

	}
	//console.log(res);
res==0? print("YES"):print("NO")

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += str[j];
			}
	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n  = readline();
var res = [0, 0, 0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += +str[j];
			}
	}
//console.log(res);
res==[0, 0, 0]? print("YES"):print("NO")

var n  = readline();
var res = [0, 0, 0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 //for (var j=0; j<1; j++){
			res[i] += +str[i];
		//	}
	}
//..console.log(res);
res==[0, 0, 0]? print("YES"):print("NO")

var n  = readline();
var res = "0 0 0".split(" ");
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += +str[j];
			}
	}
	//console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n = readline();
var temp = 0;
var res = 0;
//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");
var str = "";
		for (var i=0; i<+n; i++){

		str = readline().split(" ");
		for (var j=0; j<3; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;

	}
		res===0? print("YES"):print("NO");

var n = readline();
var temp = 0;
var res = 0;

//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");

	for (var i=0; i<n; i++){
		var str = readline().split(" ");

		for (var j=0; j<3; j++){
		   	temp += Number(str[j]);
		}
		res+= temp;
	}
	res==0? print("YES"):print("NO");

var n  = readline();
var res = [0, 0, 0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += Number(str[j]);
			}
	}
//console.log(res);
res==[0, 0, 0]? print("YES"):print("NO")

var n = readline();
var temp = 0;
var res = 0;

//var str0 = "3 -1 7 -5 2 -4 2 -1 -3".split(" ");

	for (var i=0; i<n; i++){
		var str = readline().split(" ");

		for (var j=0; j<4; j++){
			if (str[j]%1==0)
			temp += Number(str[j]);
		}
		res+= +temp;
	}
	res==0? print("YES"):print("NO");

var n  = readline();
var res = [0,0,0];
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
		 for (var j=0; j<n; j++){
			res[j] += +str[j];
			}
	}
//..console.log(res);
res=="0 0 0"? print("YES"):print("NO")

var n  = readline();
var res = 0;
   for (var i=0; i<n; i++){
		var str = readline().split(" ");// 3;
			res = Number(str[0])+Number(str[1])+Number(str[2])+res;

	}
	//console.log(res);
res==0? print("YES"):print("NO")

var n = parseInt(readline());
var xi = 0;
var yi = 0;
var zi = 0;
var f = function(num){ return parseInt(num);};
for(var i = 0; i < n; i++){
    var line = readline().split(' ').map(f);
    xi += line[0];
    yi += line[1];
    zi += line[2];
}
print((xi + yi + zi) === 0 ? 'YES' : 'NO');

var a = readline();
var input = readline().split(" ").reduce((acum, val) => acum + parseInt(val), 0);
print(input !== 0 ? "NO" : "YES");

var input = readline().split(" ").reduce((acum, val) => acum + parseInt(val), 0);
print(input !== 0 ? "NO" : "YES");

var c = readline();
var out = 0;
while (c--) {
    out += +readline()[0];
}
print(out !== 0 ? "NO" : "YES");

var c = readline();
var out = 0;
while (c--) {
    out += readline().split(" ").reduce((acum, val) => acum + parseInt(val), 0);
}
print(out !== 0 ? "NO" : "YES");


A sequence a0, a1, ..., at - 1 is called increasing if ai - 1 < ai for each i: 0 < i < t.You are given a sequence b0, b1, ..., bn - 1 and a positive integer d. In each move you may choose one element of the given sequence and add d to it. What is the least number of moves required to make the given sequence increasing?

The first line of the input contains two integer numbers n and d (2 ≤ n ≤ 2000, 1 ≤ d ≤ 106). The second line contains space separated sequence b0, b1, ..., bn - 1 (1 ≤ bi ≤ 106).

Output the minimal number of moves needed to make the sequence increasing.

function rem(a, b) {
  if (b <= 0) {
    throw Error('divisor must be positive');
  } else {
    const r = (a % b);
    return (r < 0) ? (r + b) : r;
  }
}

function quot(a, b) {
  if (b <= 0) {
    throw Error('divisor must be positive');
  } else {
    const r = rem(a, b);
    const q = ((a - r) / b);
    return q;
  }
}

function solve(d, bs) {
  let result = 0;
  let p = bs[0];
  for (let i = 1; i < bs.length; i = i + 1) {
    const b = bs[i];
    if (p < b) {
      p = b;
    } else {
      const q = quot(p - b, d);
      const k = q + 1;
      result = result + k;
      p = b + (k * d);
    }
  }
  return result;
}

function main(lns) {
  const t_lns = [];
  for (const ln of lns) {
    let t = ln.trim();
    if (t.length > 0) {
      t_lns.push(t);
    }
  }
  const [a, b] = t_lns;
  const [n, d] = a.split(/\s+/).map(Number);
  const bs = b.split(/\s+/).map(Number);
  const result = solve(d, bs);
  console.log(result);
}

async function processLinesFromStream(rs, pf) {
  const content = [];
  rs.setEncoding("utf-8");
  for await (let chunk of rs) {
    content.push(chunk);
  }
  const lines = content.join('').split(/\n/);
  const result = pf(lines);
  return result;
}

processLinesFromStream(process.stdin, main);

function rem(a, b) {
  if (b <= 0) {
    throw Error('divisor must be positive');
  } else {
    const r = (a % b);
    return (r < 0) ? (r + b) : r;
  }
}

function quot(a, b) {
  if (b <= 0) {
    throw Error('divisor must be positive');
  } else {
    const r = rem(a, b);
    const q = ((a - r) / b);
    return q;
  }
}

function solve(d, bs) {
  let result = 0;
  let p = bs[0];
  for (let i = 1; i < bs.length; i = i + 1) {
    const b = bs[i];
    if (p < b) {
      p = b;
    } else {
      const q = quot(p - b, d);
      result = result + q + 1;
      p = b + ((q + 1) * d);
    }
  }
  return result;
}

function main(lns) {
  const t_lns = [];
  for (const ln of lns) {
    let t = ln.trim();
    if (t.length > 0) {
      t_lns.push(t);
    }
  }
  const [a, b] = t_lns;
  const [n, d] = a.split(/\s+/).map(Number);
  const bs = b.split(/\s+/).map(Number);
  const result = solve(d, bs);
  console.log(result);
}

async function processLinesFromStream(rs, pf) {
  const content = [];
  rs.setEncoding("utf-8");
  for await (let chunk of rs) {
    content.push(chunk);
  }
  const lines = content.join('').split(/\n/);
  const result = pf(lines);
  return result;
}

processLinesFromStream(process.stdin, main);

const readline = require('readline');

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

var n=-1;
var d = 0;
var array =[];
var counter = 0;
var deference =0;

rl.on('line', (input) => {

    if(n++ ==-1)
    {
        array =input.split(" ");
        d =  parseInt(array[1]);
    }
    else
    {
        array =input.split(" ");
        const map =array.map(x => x*1);
        for(var i=1;i<map.length;i++)
        {
            deference = map[i-1]-map[i];
            if(deference<0) continue;
            else if (deference == 0)
            {
                counter++;
                map[i]+=d;

            }
            else
            {
                counter+=parseInt(deference/d)+1;
                map[i]+=(parseInt(deference/d)+1)*d;
            }
        }
        console.log(counter);
        rl.close();
    }
});

var lll = readline().split(' ')
var N = +lll[0]
var D = +lll[1]

var ns = readline().split(' ').map(function (i) {return parseInt(i)})

var sn = 0

for (var i = 1; i < N; i++) {
  var dif = ns[i] - ns[i - 1]
  if (dif <= 0) {
    var inc = (-dif / D | 0) + 1
    sn += inc
    ns[i] += D * inc
  }
}

print(sn)

var count = 0;
var data = readline().split(' ').map(item => parseInt(item));
var n = data[0], h = data[1];
data = readline().split(' ').map(item => parseInt(item));
for(var i = 1; i < n; i++) {
  if(data[i - 1] >= data[i]) {
    var ans = parseInt((data[i - 1] - data[i]) / h) + 1;
    count += ans;
    data[i] += ans * h;
  }
}
print(count);

input = readline().split(" ").map(item => parseInt(item))
sequence = readline().split(" ").map(item => parseInt(item))

count = 0
var previousItem = 0
var incrementer = input[1]
for (item of sequence) {
    while (item <= previousItem) {
        mod = (previousItem - item) % incrementer
        diff = Math.floor((previousItem - item)/incrementer)
        item += diff * incrementer
        if (item <= previousItem) {
            item += incrementer
            count++
        }
        count += diff
    }
    previousItem = item
}

print(count)

input = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})
sequence = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})

for (item in sequence) {
    if (sequence[item - 1] != null) {
        if (sequence[item] < sequence[item - 1]) {
            print(item)
        }
    }
}

/*
for (i = 0; i < input[0]; i++) {

}
*/

input = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})
sequence = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})

for (item in sequence) {
    if (sequence[item - 1] != null) {
        if (sequence[item] < sequence[item - 1]) {
            print(item)
        } else if (item == sequence.length - 1) {
            print(item)
        }
    }
}

/*
for (i = 0; i < input[0]; i++) {

}
*/

input = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})
sequence = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})

for (item in sequence) {
    if (sequence[item - 1] != null) {
        if (sequence[item] < sequence[item - 1]) {
            print(item)
        } else if (sequence[item] > sequence[item - 1] && item == sequence.length - 1) {
            print("0")
        } else if (item == sequence.length - 1) {
            print(item)
        }
    }
}

/*
for (i = 0; i < input[0]; i++) {

}
*/

input = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})
sequence = readline().split(" ").map(function convert(item) {
    return parseInt(item)
})

/*count = 0
for (item in sequence) {
    if (sequence[item - 1] != null) {
        if (sequence[item] < sequence[item - 1]) {
            while (sequence[item] < sequence[item - 1]) {
                sequence[item] += input[1]
                count++
            }
        } else if (sequence[item] > sequence[item - 1] && item == sequence.length - 1) {
            print("0")
        } else if (item == sequence.length - 1) {
            print(item)
        }
    }
}

count > 0 ? print(count) : 0*/
output = ""
for (item in sequence) {
    if (sequence[item - 1] != null) {
        if (sequence[item] < sequence[item - 1]) {
            output += item
        } else if (sequence[item] > sequence[item - 1] && item == sequence.length - 1) {
            output += "0"
        } else if (item == sequence.length - 1) {
            output += item
        }
    }
}
print(output)

/*
for (i = 0; i < input[0]; i++) {

}
*/