package main

//import "strings"
import (
	"fmt"
	"os"
)

//import "math"
//import "strconv"
//import "sort"

func main() {

	var n int

	fmt.Scan(&n)

	var sx, sy, sz int

	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scan(&x, &y, &z)
		sx += x
		sy += y
		sz += z
	}

	if sx == 0 && sy == 0 && sz == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

	os.Exit(0)
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,xsum,ysum,zsum int
	fmt.Scan(&r)
	for  i := 0; i < r; i++ {
		fmt.Scan(&a,&b,&c)
		xsum += a
		ysum += b
		zsum += c
	}
	if xsum != 0 || ysum != 0 || zsum != 0{
		fmt.Printf("NO")
	} else {
		fmt.Printf("YES")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, x, y, z int
	fmt.Scan(&n)

	var rx, ry, rz int = 0, 0, 0

	for n > 0 {
		fmt.Scan(&x, &y, &z)
		rx += x
		ry += y
		rz += z
		n--
	}

	if rx == 0 && ry == 0 && rz == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

// 69A-arnold.go
package main

import (
    "fmt"
)

func main() {
    var n, x, y, z int
    xsum := 0
    ysum := 0
    zsum := 0
    fmt.Scan(&n)
    for a := n; a > 0; a-- {
        fmt.Scan(&x, &y, &z)
        xsum += x
        ysum += y
        zsum += z
    }
    if xsum == 0 && ysum == 0 && zsum == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import "fmt"

func main() {
	var n int
	sum1 := 0
	sum2 := 0
	sum3 := 0
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scanf("%d%d%d\n", &x, &y, &z)
		sum1 += x
		sum2 += y
		sum3 += z
	}
	if sum1 != 0 || sum2 != 0 || sum3 != 0 {
		fmt.Print("NO")
	} else {
		fmt.Print("YES")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	countS, _ := reader.ReadString('\n')
	count, _ := strconv.Atoi(strings.TrimSpace(countS))

	vec := [3]int{0, 0, 0}
	for i := 0; i < count; i++ {
		s, _ := reader.ReadString('\n')
		line := strings.Split(strings.TrimSpace(s), " ")
		for i, v := range line {
			force, _ := strconv.Atoi(v)
			vec[i] += force
		}
	}

	if vec[0] == 0 && vec[1] == 0 && vec[2] == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
    n := 0
    x := 0
    y := 0
    z := 0

    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        var a, b, c int
        fmt.Scan(&a, &b, &c)
        x += a; y += b; z += c
    }

    if x == 0 && y == 0 && z == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import (
    "fmt"
    )

func main() {
    var n int
    fmt.Scan(&n)

    sx, sy, sz := 0, 0, 0
    for i:=0 ; i < n ; i++ {
        var x, y, z int
        fmt.Scan(&x, &y, &z)
        sx += x
        sy += y
        sz += z
    }

    if sx == 0 && sy == 0 && sz == 0 {
        fmt.Println("YES")
        return
    }
    fmt.Println("NO")
}

package main

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

func main() {
	var n, currentInt, result1, result2, result3 int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &n)
	for index := 0; index < n; index++ {
		fmt.Fscan(reader, &currentInt)
		result1 += currentInt
		fmt.Fscan(reader, &currentInt)
		result2 += currentInt
		fmt.Fscan(reader, &currentInt)
		result3 += currentInt
	}
	if result1 == 0 && result2 == 0 && result3 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

// 69A-Mic
package main

import (
    "fmt"
)

func main() {
    var i, n, t, ti, tn, tt int
    var l int
    fmt.Scan(&l)
    for k := 0; k < l; {
        fmt.Scan(&i, &n, &t)
        ti += i
        tn += n
        tt += t
        k++
    }
    if ti == 0 && tn == 0 && tt == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	sum := []int{0, 0, 0}
	for i := 0; i < n; i++ {
		scanner.Scan()
		ln := strings.Split(scanner.Text(), " ")
		for i, v := range ln {
			x, _ := strconv.Atoi(v)
			sum[i] += x
		}
	}
	for _, v := range sum {
		if v != 0 {
			fmt.Println("NO")
			os.Exit(0)
		}
	}
	fmt.Println("YES")
}

package main
import (
    "fmt"
)
func main() {
    f := [3]int{0,0,0}
    var temp int = 0
    var n int
    fmt.Scan(&n)
    for k:=0; k<(3*n);k++ {
        fmt.Scan(&temp)
        f[k%3] += temp
    }
    if  (f[0]!=0 || f[1]!=0 || f[2]!=0){
        fmt.Println("NO")
    }else {fmt.Println("YES")}
}

package main

import "fmt"

func main() {
	var testcount int
	var forces, summ [3]int
	fmt.Scanf("%d\n", &testcount)
	for i := 0; i < testcount; i++ {
		fmt.Scanf("%d %d %d\n", &forces[0], &forces[1], &forces[2])
		summ[0] += forces[0]
		summ[1] += forces[1]
		summ[2] += forces[2]
	}
	if summ[0] == 0 && summ[1] == 0 && summ[2] == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, x, y, z int
	fmt.Scanln(&n)
	for i := 0;i < n;i++ {
		var xx, yy, zz int
		fmt.Scanln(&xx, &yy, &zz)
		x += xx
		y += yy
		z += zz
	}
	if x == 0 && y == 0 && z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"os"
)

type vector struct {
	x int
	y int
	z int
}

func main() {
	var n int
	vec := vector{
		x: 0,
		y: 0,
		z: 0,
	}
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		scanf("%d %d %d\n", &x, &y, &z)
		vec.x += x
		vec.y += y
		vec.z += z
	}

	if (vec.x == 0) && (vec.y == 0) && (vec.z == 0) {
		printf("%s\n", "YES")
	} else {
		printf("%s\n", "NO")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

//========== Implement Algorithm =======================
func solution(x int, y int, z int) bool {

	return x == 0 && y == 0 && z == 0
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var x, y, z, num int
	var ret bool
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)

	//======================= I/O ==========================
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())
	for i := 0; i < num; i++ {
		scanner.Scan()
		x += fastGetInt(scanner.Bytes())
		scanner.Scan()
		y += fastGetInt(scanner.Bytes())
		scanner.Scan()
		z += fastGetInt(scanner.Bytes())
		//fmt.Println(x, y, z)
	}
	//======================================================

	ret = solution(x, y, z)

	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

import (
	"os"
	"fmt"
)

func main() {
	var n, xSum, ySum, zSum int
	fmt.Fscanln(os.Stdin, &n)
	for i := 0; i < n; i++ {
		var i, j, k int
		fmt.Fscanln(os.Stdin, &i, &j, &k)
		xSum += i
		ySum += j
		zSum += k
	}
	if xSum == 0 && ySum == 0 && zSum == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var sx, sy, sz = 0, 0, 0
	var x, y, z int
	for i := 0; i < n; i++ {
		fmt.Scan(&x, &y, &z)
		sx += x
		sy += y
		sz += z
	}
	if sx == 0 && sy == 0 && sz == 0 {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

package main

import "fmt"

func main() {
	var sx, sy, sz int
	n := 0
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scanf("%d %d %d\n", &x, &y, &z)
		sx += x
		sy += y
		sz += z
	}
	ans := sx == 0 && sy == 0 && sz == 0
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import(
	"fmt"
)

func main(){
	var n int;
	fmt.Scan(&n)

	x,y,z,inp := 0 , 0 , 0 , 0

	for i:= 0 ; i < n ; i++ {
		fmt.Scan(&inp)
		x = x + inp
		fmt.Scan(&inp)
		y += inp
		fmt.Scan(&inp)
		z += inp
	}

	if x == 0 && y == 0 && z== 0 {
		fmt.Print("YES")
	}else{
		fmt.Print("NO")
	}

}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	var resA, resB, resC int
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		resA, resB, resC = resA+a, resB+b, resC+c
	}
	if resA == 0 && resB == 0 && resC == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
	// Test comment
}

package main

import "fmt"

func main() {
    var n,x,y,z int
    tx, ty, tz := 0, 0, 0
    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        fmt.Scan(&x,&y,&z)
        tx += x
        ty += y
        tz += z
    }
    if (tx == 0) && (ty == 0) && (tz == 0) {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import "fmt"
import "bytes"
import "io/ioutil"
import "os"
import "strconv"

func task_solution(a [][]int) string {
	res := make([]int, len(a[0]))
	for _, line := range a {
		for i := range line {
			res[i] += line[i]
		}
	}

	for _, item := range res {
		if item != 0 {
			return "NO"
		}
	}

	return "YES"
}

func main() {
	var n int
	_, err := fmt.Scan(&n)
	if err != nil {
		panic(err)
	}

	in_raw, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err)
	}
	in_raw_line := bytes.Split(bytes.TrimSpace(in_raw), []byte("\n"))
	in := [][]int{}
	for i, line := range in_raw_line {
		in = append(in, []int{})
		in_raw_arr := bytes.Split(bytes.TrimSpace(line), []byte(" "))
		for _, item := range in_raw_arr {
			parsed_int, err := strconv.Atoi(string(item))
			if err != nil {
				panic(err)
			}
			in[i] = append(in[i], parsed_int)
		}
	}

	fmt.Println(task_solution(in))
}

package main

// https://codeforces.com/problemset/problem/69/A

import "fmt"

type point struct {
	x int
	y int
	z int
}

func task_solution(a []point) string {
	res := point{}
	for _, p := range a {
		res.x += p.x
		res.y += p.y
		res.z += p.z
	}

	if res.x == 0 && res.y == 0 && res.z == 0 {
		return "YES"
	}
	return "NO"
}

func main() {
	var n int
	_, err := fmt.Scan(&n)
	if err != nil {
		panic(err)
	}

	a := []point{}
	for i := 0; i < n; i += 1 {
		var x, y, z int
		if _, err := fmt.Scan(&x, &y, &z); err != nil {
			panic(err)
		}
		a = append(a, point{x, y, z})
	}

	fmt.Println(task_solution(a))
}

// Author: sighduck
// URL: https://codeforces.com/problemset/problem/69/A

package main

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

type Coordinate struct {
	Xi int
	Yi int
	Zi int
}

func Solve(n int, coordinates []Coordinate) string {
	xsum := 0
	ysum := 0
	zsum := 0
	for _, c := range coordinates {
		xsum += c.Xi
		ysum += c.Yi
		zsum += c.Zi
	}
	if xsum == 0 && ysum == 0 && zsum == 0 {
		return "YES"
	}
	return "NO"
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	coordinates := make([]Coordinate, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(reader, "%d %d %d\n", &coordinates[i].Xi, &coordinates[i].Yi, &coordinates[i].Zi)
	}

	fmt.Fprintf(writer, "%s\n", Solve(n, coordinates))
}

package main

import (
	"fmt"
)

func main() {
	var n, i, j, sum int
	fmt.Scanln(&n)

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

	for j = 0; j < 2; j++ {
		sum = 0
		for i = 0; i < n; i++ {
			sum += body[i][j]
		}

		if sum != 0 {
			fmt.Println("NO")
			break
		}
	}

	if j == 2 && sum == 0 {
		fmt.Println("YES")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, x, y, z, a, b, c int
	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&x, &y, &z)
		a+=x
		b+=y
		c+=z
	}
	if a == 0 && b == 0 && c == 0 {fmt.Println("YES")
	} else {fmt.Println("NO")}
}

package main

import (
	"fmt"
)

func main() {
	var n, sumx, sumy, sumz int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scan(&x, &y, &z)
		sumx += x
		sumy += y
		sumz += z
	}
	if sumx == 0 && sumy == 0 && sumz == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {

	var N, res1, res2, res3, x, y, z int
	fmt.Scanln(&N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%d %d %d\n", &x, &y, &z)
		res1 += x
		res2 += y
		res3 += z
	}

	if res1 == 0 && res2 == 0 && res3 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main
import(
"fmt"
"os")

func main(){
    var n int
    var x, y, z int
    xTotal:= 0
    yTotal := 0
    zTotal := 0
    fmt.Scan(&n)
    for i:=0; i< n; i++ {
        fmt.Scan(&x,&y,&z)
        xTotal += x
        yTotal += y
        zTotal += z
    }

   if xTotal == 0 && yTotal ==0 && zTotal == 0 {
       fmt.Fprintf(os.Stdout, "%s",  "YES")
   }else {
       fmt.Fprintf(os.Stdout,"%s", "NO")
   }
}

package main

import "fmt"

func main() {
    var n int
    //var sum_x, sum_y, sum_z int
    sum_x:=0
    sum_y:=0
    sum_z:=0
    fmt.Scanln(&n)
    var x[100]int
    var y[100]int
    var z[100]int
    for i:=0; i<n; i++ {
        fmt.Scanln(&x[i], &y[i], &z[i])
        sum_x+=x[i]
        sum_y+=y[i]
        sum_z+=z[i]
    }
    if (sum_x==0 && sum_y==0 && sum_z==0) {
        fmt.Print("YES\n");
    } else {
        fmt.Print("NO\n");
    }
}

package main

import "fmt"

func main() {
    var n int
    //var sum_x, sum_y, sum_z int
    sum_x:=0
    sum_y:=0
    sum_z:=0
    fmt.Scanln(&n)
    for i:=1; i<=n; i++ {
        var x, y, z int
        fmt.Scanln(&x, &y, &z)
        sum_x+=x
        sum_y+=y
        sum_z+=z
    }
    if (sum_x==0 && sum_y==0 && sum_z==0) {
        fmt.Print("YES\n");
    } else {
        fmt.Print("NO\n");
    }
}

package main

import "fmt"

func main() {
	var num int
	_, _ = fmt.Scanln(&num)
	var twodslices = make([][3]int, num)
	for i:=0; i<num; i++ {
		for j:=0; j<3; j++ {
			_, _ = fmt.Scan(&twodslices[i][j])
		}
	}
	flag := 0
	for i:=0; i<3; i++ {
		count :=0
		for j:=0; j<num; j++ {
			count = count + twodslices[j][i]
		}
		if count != 0 {
			fmt.Println("NO")
			flag = 1
			break
		}
	}
	if flag == 0 {
		fmt.Println("YES")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)

	arr := [3]int{}
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d %d %d\n", &a, &b, &c)

		arr[0] += a
		arr[1] += b
		arr[2] += c
	}

	if arr[0] == 0 && arr[1] == 0 && arr[2] == 0 {
		fmt.Println("YES\n")
	} else {
		fmt.Println("NO\n")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)

	arr := []int{0, 0, 0}
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d %d %d\n", &a, &b, &c)

		arr[0] += a
		arr[1] += b
		arr[2] += c
	}

	if arr[0] == 0 && arr[1] == 0 && arr[2] == 0 {
		fmt.Println("YES\n")
	} else {
		fmt.Println("NO\n")
	}
}

package main
import (
	"fmt"
)
func main() {
	f := [3]int{0,0,0}
	var temp int = 0
	var n int
	fmt.Scan(&n)
	for k:=0; k<(3*n);k++ {
		fmt.Scan(&temp)
		f[k%3] += temp
	}
	if  (f[0]!=0 || f[1]!=0 || f[2]!=0){
		fmt.Println("NO")
	}else {fmt.Println("YES")}
}

package main

import "fmt"

type vec3 [3]int

func (v vec3) Equilibrium() bool {
	return (v[0] == 0) && (v[1] == 0) && (v[2] == 0)
}

func main() {
	var n int
	var sum vec3

	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var val int
		for j := 0; j < len(sum); j++ {
			fmt.Scan(&val)
			sum[j] += val
		}
	}
	if sum.Equilibrium() {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var countVectors int
	fmt.Scan(&countVectors)

	const vectorLen = 3
	var coordSum [vectorLen]int

	for ; countVectors > 0; countVectors-- {
		for i := 0; i < vectorLen; i++ {
			var n int
			fmt.Scan(&n)
			coordSum[i] += n
		}
	}

	for i := 0; i < vectorLen; i++ {
		if coordSum[i] != 0 {
			fmt.Println("NO")
			goto out
		}
	}
	fmt.Println("YES")
out:
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var sx, sy, sz int
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scan(&x, &y, &z)
		sx += x
		sy += y
		sz += z
	}
	if sx == 0 && sy == 00 && sz == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func solve() {
	X := 0
	Y := 0
	Z := 0
	n := readInt()
	for i := 0; i < n; i++ {
		X += readInt()
		Y += readInt()
		Z += readInt()
	}
	if X == 0 && Y == 0 && Z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

package main

import (
  "fmt"
)

func main() {
  var n, p int
  fmt.Scan(&n)
  x := 0
  y := 0
  z := 0
  for i := 0; i < n*3; i++ {
    fmt.Scan(&p)
    if (i+1)%3==1{
      x += p
    } else if (i+1)%3==2 {
      y += p
    } else {
      z += p
    }
  }
  if x==0 && y==0 && z==0{
    fmt.Print("YES")
  } else {
    fmt.Print("NO")
  }
}

// @problemURL https://codeforces.com/problemset/problem/69/A
package main

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

func nt(s *bufio.Scanner) string {
	s.Scan()
	return s.Text()
}

func ni(s *bufio.Scanner) int {
	return atoi(nt(s))
}

func atoi(s string) int {
	i, err := strconv.Atoi(s)
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	var in = bufio.NewReader(os.Stdin)
	s := bufio.NewScanner(in)
	s.Split(bufio.ScanWords)

	// Code
  n := ni(s)
  var x, y, z int
  for i := 0; i < n; i++ {
    x += ni(s)
    y += ni(s)
    z += ni(s)
  }
  if x == 0 && y == 0 && z == 0 {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

import "fmt"

func main() {

	var n int
	fmt.Scan(&n)

	vectors := make([]struct {
		x, y, z int
	}, n)

	for i := 0; i < n; i++ {
		fmt.Scan(&vectors[i].x, &vectors[i].y, &vectors[i].z)
	}

	var x, y, z int
	for i := 0; i < n; i++ {
		x += vectors[i].x
		y += vectors[i].y
		z += vectors[i].z
	}

	if x == 0 && y == 0 && z == 0 {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}

}

package main
import (
	"fmt"
)
func main() {
	var n int
	xx:=0
	yy:=0
	zz:=0
	fmt.Scan(&n)
	x:=make([]int,n)
	y:=make([]int,n)
	z:=make([]int,n)
	for i:=0; i<n;i++{
		fmt.Scan(&x[i],&y[i],&x[i])
		xx += x[i]
		yy += y[i]
		zz += z[i]
		}
	if (xx==0) && (yy==0) && (zz==0){
		fmt.Println("YES")
		}else{
		fmt.Println("NO")
		}
	}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var X, Y, Z int
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scan(&x, &y, &z)
		X += x
		Y += y
		Z += z
	}
	if X == 0 && Y == 0 && Z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var sum, f [3]int
	for i := 0; i < n; i++ {
		fmt.Scan(&f[0], &f[1], &f[2])
		for j := range sum {
			sum[j] += f[j]
		}
	}
	var move bool
	for i := range sum {
		if sum[i] != 0 {
			move = true
			break
		}
	}
	if move {
		fmt.Print("NO")
	} else {
		fmt.Print("YES")
	}
}

package main

import "fmt"

func main() {
	var a, b, c int
	suma, sumb, sumc := 0, 0 ,0
	var n int

	_, _ = fmt.Scanln(&n)

	for i := 0; i < n; i++ {
		_, _ = fmt.Scanln(&a, &b, &c)
		suma += a
		sumb += b
		sumc += c
	}
	if suma == 0 && sumb == 0 && sumc == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

import "fmt"

func main() {
    var n,x,y,z int
    tx, ty, tz := 0, 0, 0
    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        fmt.Scan(&x,&y,&z)
        tx += x
        ty += y
        tz += z
    }
    if (tx == 0) && (ty == 0) && (tz == 0) {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

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

func main() {
	var scanner *bufio.Scanner
	var n uint8
	var line []string
	var x, y, z []int16
	var xSum, ySum, zSum int16

	scanner = bufio.NewScanner(os.Stdin)

	fmt.Scanln(&n)

	var i uint8
	for i = 0; i < n; i++ {
		if scanner.Scan() {
			line = strings.Fields(scanner.Text())
			for i, str := range line {
				number, err := strconv.Atoi(str)
				if err != nil {
					panic(err)
				}
				if i == 0 {
					x = append(x, int16(number))
				} else if i == 1 {
					y = append(y, int16(number))
				} else {
					z = append(z, int16(number))
				}
			}
		}
	}

	xSum = sum(x)
	ySum = sum(y)
	zSum = sum(z)

	if xSum == 0 && ySum == 0 && zSum == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func sum(array []int16) int16 {
	var result int16 = 0

	for _, element := range array {
		result += element
	}

	return result
}

package main
import "fmt"

func main(){
	// your code goes here
	var n int
	fmt.Scan(&n)
	x, y, z := 0, 0, 0
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		x += a
		y += b
		z += c
	}

	if x == 0 && y == 0 && z == 0{
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main
import (
	"fmt"
)
func main() {
	var no, a, b,c, tmp, tmp1, tmp2 int
	fmt.Scan(&no)
	tmp = 0
	tmp1 = 0
	tmp2 = 0
	arr := []int{}
	arr1 := []int{}
	arr2 := []int{}
	for i := 0; i < no; i++ {
		fmt.Scan(&a, &b, &c)
		arr = append(arr, a)
		arr1 = append(arr1, b)
		arr2 = append(arr2, c)
	}
	for j := 0; j < len(arr); j++ {
		tmp = tmp + arr[j]
		tmp1 = tmp1 + arr1[j]
		tmp2 = tmp2 + arr2[j]
	}
	if tmp == 0 && tmp1 == 0 && tmp2 == 0 {
 		fmt.Println("YES")
	}else {
		fmt.Println("NO")
}
}

/* https://codeforces.com/problemset/problem/69/A
A. Young Physicist
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
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.

Examples
inputCopy
3
4 1 7
-2 4 -1
1 -5 -3
outputCopy
NO
inputCopy
3
3 -1 7
-5 2 -4
2 -1 -3
outputCopy
YES
*/

package main

import "fmt"

func main() {
	var rows int
	fmt.Scanln(&rows)

	coordinates := make([]int, 3)
	var x, y, z int
	for row := 0; row < rows; row++ {
		/*		for column := 0; column < 3; column++ {
				fmt.Scan(&coordinates[column])
			}*/
		fmt.Scanln(&coordinates[0], &coordinates[1], &coordinates[2])
		x += coordinates[0]
		y += coordinates[1]
		z += coordinates[2]
	}

	if x == 0 && y == 0 && z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

/* https://codeforces.com/problemset/problem/69/A
A. Young Physicist
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
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.

Examples
inputCopy
3
4 1 7
-2 4 -1
1 -5 -3
outputCopy
NO
inputCopy
3
3 -1 7
-5 2 -4
2 -1 -3
outputCopy
YES
*/

package main

import "fmt"

func main() {
	var rows int
	fmt.Scanln(&rows)

	coordinates := make([]int, 3)
	var x, y, z int
	for row := 0; row < rows; row++ {
		for column := 0; column < 3; column++ {
			fmt.Scan(&coordinates[column])
		}
		x += coordinates[0]
		y += coordinates[1]
		z += coordinates[2]
	}

	if x == 0 && y == 0 && z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

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

type vector3 struct {
	x, y, z int
}

func addVectors(a, b vector3) vector3 {
	return vector3{a.x + b.x, a.y + b.y, a.z + b.z}
}

func main() {
	var pos vector3
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	for scanner.Scan() {
		var v vector3
		if _, err := fmt.Sscanf(scanner.Text(), "%d %d %d", &v.x, &v.y, &v.z); err != nil {
			continue
		}
		pos = addVectors(pos, v)
	}

	if pos.x == 0 && pos.y == 0 && pos.z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var x, y, z, xSum, ySum, zSum int

	for i := 0; i < n; i++ {
		fmt.Scan(&x)
		fmt.Scan(&y)
		fmt.Scan(&z)
		xSum += x
		ySum += y
		zSum += z
	}

	if xSum == 0 && ySum == 0 && zSum == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func cleanString(stream string, seperator string) []int {
	trimmedStream := strings.TrimSpace(stream)
	splitArr := strings.Split(trimmedStream, seperator)
	// convert strings to integers and store them in a slice
	cleanArr := make([]int, len(splitArr))
	for index, val := range splitArr {
		cleanArr[index], _ = strconv.Atoi(val)
	}
	return cleanArr
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	n, _ := reader.ReadString('\n')
	intN, _ := strconv.Atoi(strings.TrimSpace(n))

	result := new([3]int)
	for intN > 0 {
		inputLine, _ := reader.ReadString('\n')
		point := cleanString(inputLine, " ")
		result[0] += point[0]
		result[1] += point[1]
		result[2] += point[2]
		intN--
	}
	equi := true
	for i := 0; i < 3; i++ {
		if result[i] != 0 {
			equi = false
		}
	}
	if equi {
		fmt.Println("YES")
		return
	}
	fmt.Println("NO")
}

package main

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

func main (){
	reader := bufio.NewReader(os.Stdin)

	nByte,_,_:=reader.ReadLine()
	nString := string(nByte)
	n,_:=strconv.Atoi(nString)

	var a [3]int

	for i:=0;i<n;i++ {
		line,_,_:=reader.ReadLine()
		vals:=strings.Split(string(line)," ")
		a1,_ := strconv.Atoi(vals[0])
		a2,_ := strconv.Atoi(vals[1])
		a3,_ := strconv.Atoi(vals[2])

		a[0]+=a1
		a[1]+=a2
		a[2]+=a3
	}

	if a[0]==0 && a[1]==0 && a[2]==0 {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

package main

import "fmt"

func main() {
    var a,b,c,t1,t2,t3,n int
    fmt.Scan(&n)

    for i:=0;i<n;i++ {
        fmt.Scan(&t1,&t2,&t3)
        a+=t1
        b+=t2
        c+=t3
    }
    if a==0 && b==0 && c==0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import "fmt"

func main() {
	var n int
	var sum, f [3]int

	fmt.Scanln(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&f[0], &f[1], &f[2])
		for j := range sum {
			sum[j] += f[j]
		}
	}
	for i := range sum {
		if sum[i] != 0 {
			fmt.Print("NO")
			break
		}else{
			fmt.Print("YES")
			break

		}

	}

}

package main

import (
	"fmt"
)

func main() {
	n := 0
	fmt.Scanf("%d\r\n", &n)
	x, y, z := 0, 0, 0
	sx, sy, sz := 0, 0, 0
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d %d\r\n", &x, &y, &z)
		sx += x
		sy += y
		sz += z
	}
	if sx == 0 && sy == 0 && sz == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	x, y, z := 0, 0, 0
	var x1, y1, z1 int
	for i := 0; i < n; i++ {
		fmt.Scan(&x1, &y1, &z1)
		x += x1
		y += y1
		z += z1
	}

	if x != 0 || y != 0 || z != 0 {
		fmt.Print("NO")
	} else {
		fmt.Print("YES")
	}
}

package main

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

var n int

func main() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader := bufio.NewReaderSize(stdin, 1<<20)
	fmt.Fscanf(reader, "%d\n", &n)

	var x, y, z int
	for ; n != 0; n-- {
		var xi, yi, zi int
		fmt.Fscanf(reader, "%d%d%d\n", &xi, &yi, &zi)
		x += xi
		y += yi
		z += zi
	}
	if x == 0 && y == 0 && z == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, i, j, k, p, q, r int
	fmt.Scan(&n)
	for n > 0 {
		fmt.Scan(&i, &j, &k)
		p += i
		q += j
		r += k
		n--
	}

	if p == 0 && q == 0 && r == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var x, y, z int
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		x += a
		y += b
		z += c
	}
	if x == 0 && y == 0 && z == 0 {
		fmt.Print("YES")
		return
	}
	fmt.Print("NO")
}

package main

import (
	"fmt"
)

func main() {
	var n, x, y, z, sum int
	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&x, &y, &z)
		x+=x
		y+=y
		z+=z
	}
	sum = x + y + z
	fmt.Println(sum)
	if sum == 0 {fmt.Println("YES")
	} else {fmt.Println("NO")}
}

package main

import (
	"fmt"
)

func main() {
	var n, x, y, z, sum int
	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&x, &y, &z)
		sum += x + y + z
	}
	if sum == 0 {fmt.Println("YES")
	} else {fmt.Println("NO")}
}

package main

import "fmt"

func main() {

	var N, res1, res2, res3, x, y, z int
	for i := 0; i < N; i++ {
		fmt.Scanf("%d %d %d\n", &x, &y, &z)
		res1 += x
		res2 += y
		res3 += z
	}

	if res1 == 0 && res2 == 0 && res3 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main
import(
"fmt"
"os")

func main(){
    var n int
    var x, y, z int
    xTotal:= 0

    fmt.Scan(&n)
    for i:=0; i< n; i++ {
        fmt.Scan(&x,&y,&z)
        xTotal += x + y + z
    }

   if xTotal == 0 {
       fmt.Fprintf(os.Stdout, "%s",  "YES")
   }else {
       fmt.Fprintf(os.Stdout,"%s", "NO")
   }
}

package main

import "fmt"

func main() {
	var num int
	_, _ = fmt.Scanln(&num)
	var twodslices = make([][]int, num)
	var i int
	for i = range twodslices {
		twodslices[i] = make([]int, num)
	}
	for i:=0; i<num; i++ {
		for j:=0; j<num; j++ {
			_, _ = fmt.Scan(&twodslices[i][j])
		}
	}
	flag := 0
	for i:=0; i<num; i++ {
		count :=0
		for j:=0; j<num; j++ {
			count = count + twodslices[j][i]
		}
		if count != 0 {
			fmt.Println("NO")
			flag = 1
			break
		}
	}
	if flag == 0 {
		fmt.Println("YES")
	}
}

package main

import (
  "fmt"
)

func main() {
  var n, p, sum int
  fmt.Scan(&n)
  for i := 0; i < n*n; i++ {
    fmt.Scan(&p)
    sum += p
  }
  if sum == 0{
    fmt.Print("YES")
  } else {
    fmt.Print("NO")
  }
}

package main

import (
  "fmt"
)

func main() {
  var n, p int
  fmt.Scan(&n)
  x := 0
  y := 0
  z := 0
  for i := 0; i < n*3; i++ {
    fmt.Scan(&p)
    if (i+1)%3==1{
      x += p
    } else if (i+1)%3==2 {
      y += p
    } else {
      z += p
    }
    fmt.Println(x,y,z)
  }
  if x==0 && y==0 && z==0{
    fmt.Print("YES")
  } else {
    fmt.Print("NO")
  }
}

package main

import (
  "fmt"
)

func main() {
  var n, p int
  fmt.Scan(&n)
  x := 0
  y := 0
  z := 0
  for i := 0; i < n*n; i++ {
    fmt.Scan(&p)
    if (i+1)%3==1{
      x += p
    } else if (i+1)%3==2 {
      y += p
    } else {
      z += p
    }
  }
  if x==0 && y==0 && z==0{
    fmt.Print("YES")
  } else {
    fmt.Print("NO")
  }
}

package main

import (
  "fmt"
)

func main() {
  var n, p, sum int64
  fmt.Scan(&n)
  for i := int64(0); i < n*n; i++ {
    fmt.Scan(&p)
    sum += p
  }
  if sum == 0{
    fmt.Print("YES")
  } else {
    fmt.Print("NO")
  }
}

package main

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

func main() {
	var scanner *bufio.Scanner
	var n uint8
	var line []string
	var sum int16

	scanner = bufio.NewScanner(os.Stdin)

	fmt.Scanln(&n)

	var i uint8
	for i = 0; i < n; i++ {
		if scanner.Scan() {
			line = strings.Fields(scanner.Text())
			for _, str := range line {
				number, err := strconv.Atoi(str)
				if err != nil {
					panic(err)
				}
				sum += int16(number)
			}
		}
	}

	if sum == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func cleanString(stream string, seperator string) []int {
	trimmedStream := strings.TrimSpace(stream)
	splitArr := strings.Split(trimmedStream, seperator)
	// convert strings to integers and store them in a slice
	cleanArr := make([]int, len(splitArr))
	for index, val := range splitArr {
		cleanArr[index], _ = strconv.Atoi(val)
	}
	return cleanArr
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	n, _ := reader.ReadString('\n')
	intN, _ := strconv.Atoi(strings.TrimSpace(n))

	result := new([3]int)
	for intN > 0 {
		inputLine, _ := reader.ReadString('\n')
		point := cleanString(inputLine, " ")
		result[0] += point[0]
		result[1] += point[1]
		result[2] += point[2]
		intN--
	}
	equi := true
	for i := 0; i < 3; i++ {
		if result[i] != 0 {
			equi = false
		}
	}
	fmt.Println(equi)
}

package main

import "fmt"

func main() {
    var a,b,c,t1,t2,t3,n int
    fmt.Scan(&n)

    for i:=0;i<n;i++ {
        fmt.Scan(&t1,&t2,&t3)
        a+=t1
        b+=t2
        c+=t3
    }
    if a==0 && b==0 && c==0 {
        fmt.Println("Yes")
    } else {
        fmt.Println("No")
    }
}

package main

import (
	"fmt"
)

func main() {
	n := 0
	fmt.Scanf("%f", &n)
	x, y, z := 0, 0, 0
	sx, sy, sz := 0, 0, 0
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d %d\r\n", &x, &y, &z)
		sx += x
		sy += y
		sz += z
	}
	if sx == 0 && sy == 0 && sz == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum int
	fmt.Scanf("%d",&r)
	for r != 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
		r -= 1
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
		sum = 0
		r = 0
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r int
	var sum = 0
	fmt.Scanf("%d",&r)
	for r != 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
		r -= 1
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum int
	sum = 0
	fmt.Scanf("%d",&r)
	for  i := 0; i < r; i++ {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r int
	var sum = 0
	fmt.Scanf("%d",&r)
	for r != 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
		r -= 1
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
		sum = 0
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum,x,y,z int
	sum = 0
	fmt.Scanf("%d",&r)
	for  i := 0; i < r; i++ {
		fmt.Scanf("%d %d %d \n",&a,&b,&c)
		x += a
		y += b
		z += c
	}
	sum = (x+y+z)
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum int
	fmt.Scanf("%d",&r)
	for r != 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
		r -= 1
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,x,y,z,r int
	fmt.Scanf("%d",&r)
	for r != 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		x += a
		y += b
		z += c
		r -= 1
	}
	if (x+y+z) == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum,x,y,z int
	sum = 0
	fmt.Scanf("%d",&r)
	for  i := 0; i < r; i++ {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		x += a
		y += b
		z += c
	}
	sum = (x+y+z)
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,xsum,ysum,zsum int
	fmt.Scanf("%d",&r)
	for  i := 0; i < r; i++ {
		fmt.Scanf("%d %d %d \n",&a,&b,&c)
		xsum += a
		ysum += b
		zsum += c
	}
	if xsum == 0 && ysum == 0 && zsum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum int
	fmt.Scanf("%d",&r)
	for r > 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
		r -= 1
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
		// sum = 0
		// a = 0
		// b = 0
		// c = 0
		// r = 0
	}
}

package main

import (
		"fmt"
)
func main() {
	var a,b,c,r,sum int
	sum = 0
	fmt.Scanf("%d",&r)
	for r > 0 {
		fmt.Scanf("%d %d %d",&a,&b,&c)
		sum += (a+b+c)
		r -= 1
	}
	if sum == 0{
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}

// 69A-arnold.go
package main

import (
    "fmt"
)

func main() {
    var n, x, y, z int
    xsum := 0
    ysum := 0
    zsum := 0
    fmt.Scan(&n)
    for a := n; a >= 0; a-- {
        fmt.Scan(&x, &y, &z)
        xsum += x
        ysum += y
        zsum += z
    }
    if xsum == 0 && ysum == 0 && zsum == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

// 69A-arnold.go
package main

import (
    "fmt"
)

func main() {
    var n, x, y, z, xsum, ysum, zsum int
    fmt.Scan(&n)
    for a := n; a >= 0; a-- {
        fmt.Scan(&x, &y, &z)
        xsum += x
        ysum += y
        zsum += z
    }
    if xsum == 0 && ysum == 0 && zsum == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import "fmt"

func main() {
	var n int
	sum := 0
	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scanf("%d%d%d", &x, &y, &z)
		sum += x + y + z
	}
	if sum != 0 {
		fmt.Print("NO")
	} else {
		fmt.Print("YES")
	}
}

package main

import "fmt"

func main() {
	var n int
	sum := 0
	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scanf("%d %d %d", &x, &y, &z)
		sum += x + y + z
	}
	if sum != 0 {
		fmt.Print("NO")
	} else {
		fmt.Print("YES")
	}
}

package main

import "fmt"

func main() {
	var n int
	sum := 0
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scanf("%d%d%d\n", &x, &y, &z)
		sum += (x + y + z)
	}
	if sum != 0 {
		fmt.Print("NO")
	} else {
		fmt.Print("YES")
	}
}

package main

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

func main() {
	var n, currentInt, result int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &n)
	for index := 0; index < n*3; index++ {
		fmt.Fscan(reader, &currentInt)
		result += currentInt
	}
	if result == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

// 69A-Mic
package main

import (
    "fmt"
)

func main() {
    var i, n, t, sum int
    var l int
    fmt.Scan(&l)
    for k := 0; k < l; {
        fmt.Scan(&i, &n, &t)
        sum += i + n + t
        k++
    }
    if sum == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	sum := []int{0, 0, 0}
	for i := 0; i < n; i++ {
		scanner.Scan()
		ln := strings.Split(scanner.Text(), " ")
		for i, v := range ln {
			x, _ := strconv.Atoi(v)
			sum[i] += x
		}
	}
	result := 0
	for _, v := range sum {
		result += v
	}
	if result == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    writer := bufio.NewWriter(os.Stdout)
    var n int
    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        for scanner.Scan() {
            if scanner.Text() != "" { break }
        }
        s := scanner.Text()
        var ch byte
        found_C := false
        for in, v := range s {
            if v == 'R' { ch = s[in+1] }
            if v == 'C' { found_C = true; break }
        }
        if (ch >= '0') && (ch <= '9') && found_C {
            r, c, in := 0, 0, 1
            for ; s[in] != 'C'; in++ {
                r = (r*10) + int(s[in]-'0')
            }
            for in++; in < len(s); in++ {
                c = (c*10) + int(s[in]-'0')
            }
            col, row := "", strconv.Itoa(r)
            c--
            for c >= 0 {
                a := c%26
                col = string(rune('A'+a)) + col
                if c == 0 {
                    c = -1
                } else {
                    c = (c/26)-1
                }
            }
            writer.WriteString(col+row+"\n")
        } else {
            col, row := 0, ""
            for _, v := range s {
                if (v >= 'A') && (v <= 'Z') {
                    col = (col*26) + int(v-'A'+1)
                } else {
                    row += string(v)
                }
            }
            writer.WriteString("R"+row+"C"+strconv.Itoa(col)+"\n")
        }
    }
    writer.Flush()
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var total int

	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		scanf("%d %d %d\n", &x, &y, &z)
		total += (x + y + z)
	}

	printf("Total : %d\n", total)
	if total == 0 {
		printf("%s\n", "NO")
	} else {
		printf("%s\n", "YES")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var total int
	var x, y, z int
	var x1, y1, z1 int
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		x += x1
		y += y1
		z += z1
		scanf("%d %d %d\n", &x1, &y1, &z1)
	}
	total = x+y+z

	if total == 0 {
		printf("%s\n", "YES")
	} else {
		printf("%s\n", "NO")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var total int

	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		scanf("%d %d %d\n", &x, &y, &z)
		total += (x + y + z)
	}

	if total == 0 {
		printf("%s\n", "NO")
	} else {
		printf("%s\n", "YES")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var total int

	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		scanf("%d %d %d\n", &x, &y, &z)
		total += (x + y + z)
	}

	if total == 0 {
		printf("%s\n", "YES")
	} else {
		printf("%s\n", "NO")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var total int

	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		scanf("%d %d %d\n", &x, &y, &z)
		total += (x + y + z)
	}

	if total > 0 {
		printf("%s\n", "NO")
	} else {
		printf("%s\n", "YES")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

type vector struct {
	x int
	y int
	z int
}

func main() {
	var n int
	var vec vector
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		scanf("%d %d %d\n", &x, &y, &z)
		vec.x = vec.x + x
		vec.y = vec.y + y
		vec.z = vec.z + z
	}

	if (vec.x + vec.y + vec.z) == 0 {
		printf("%s\n", "YES")
	} else {
		printf("%s\n", "NO")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"os"
	"fmt"
)

func main() {
	var xSum, ySum, zSum int
	for {
		var i, j, k int
		_, err := fmt.Fscanln(os.Stdin, &i, &j, &k)
		if err != nil { break }
		xSum += i
		ySum += j
		zSum += k
	}
	if xSum == 0 && ySum == 0 && zSum == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	ans := 0
	n := 0
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scanf("%d %d %d\n", &x, &y, &z)
		ans += x + y + z
	}
	if ans == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	var resA, resB, resC int
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d %d %d", &a, &b, &c)
		resA, resB, resC = resA+a, resB+b, resC+c
	}
	if resA == 0 && resB == 0 && resC == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
	// Test comment
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	var resA, resB, resC int
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d %d %d", &a, &b, &c)
		resA, resB, resC = resA+a, resB+b, resC+c
	}
	if resA == 0 && resB == 0 && resC == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, x, y, z int
	fmt.Scanln(&n)

	sum := 0
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d %d\n", &x, &y, &z)
		sum += x + y + z
	}

	if sum == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
    "fmt"
    "math"
)

func main() {
    var n,d int
    fmt.Scan(&n,&d)
    b := make([]int,n)
    for i := 0; i < n; i++ { fmt.Scan(&b[i]) }
    ans := 0
    for i := 1; i < n; i++ {
        if b[i] <= b[i-1] {
            x := b[i-1]-b[i]+1
            a := int(math.Ceil(float64(x)/float64(d)))
            ans += a
            b[i] += a*d
        }
    }
    fmt.Println(ans)
}

package main

import "os"
import "bufio"
import "strconv"

func main(){
	var n, d int
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.Atoi(r.Text())
	r.Scan()
	d, _ = strconv.Atoi(r.Text())
	b := make([]int, n)
	min := 0
	for i:=0; i<n; i++ {
		r.Scan()
		b[i], _ = strconv.Atoi(r.Text())
	}
	req := 0
	for j:=1; j<n; j++ {
		if b[j] <= b[j-1] {
			req = 1 + (b[j-1]-b[j])/d
			b[j] += req * d
			min += req
		}
	}
	w.WriteString(strconv.Itoa(min)+"\n")
	w.Flush()
}

package main

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

var scanner *bufio.Scanner

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer := bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  n, d := getI(), getI()
  result := 0
  previous := getI()
  for i := 1; i < n; i++ {
    current := getI()
    if current <= previous {
      moves := (previous - current + d) / d
      result += moves
      current += moves * d
    }
    previous = current
  }
  writer.WriteString(fmt.Sprintf("%d\n", result))
}

package main
import "fmt"

func main() {
	var n, d, count int
	fmt.Scan(&n, &d)
	arr := make([]int, n)
	for i:=0; i < n; i++{
		fmt.Scan(&arr[i])
	}
	for i := 1; i < n; i++{
		if arr[i] <= arr[i-1]{
			dif := arr[i-1] - arr[i]
			arr[i]+= d*(dif/d + 1)
			count += dif / d + 1
		}
	}
	fmt.Print(count)
}

// http://codeforces.com/problemset/problem/11/A
// A. Increasing Sequence

package main

import (
	"fmt"
)

func main() {
	var (
		j, n, d, prev, akt, ans, add int32
		//b                       []int32
	)

	fmt.Scan(&n)
	fmt.Scan(&d)
	fmt.Scan(&prev)
	ans = 0
	for j = 1; j < n; j++ {
		fmt.Scan(&akt)
		if akt <= prev {
			add = 1 + (prev-akt)/d
			akt = akt + add*d
			ans += add
		}
		prev = akt
	}

	fmt.Println(ans)

}

package main

import (
    "fmt"
    "math"
)

func main() {
    var n,d int // variabel n dan d adalah integer
    fmt.Scan(&n,&d) // meminta input n dan d
    b := make([]int,n) // b adalah array of integer yang panjangnya n
    for i := 0; i < n; i++ { fmt.Scan(&b[i]) } // lakukan selama kondisi ini dan meminta input b
    ans := 0 // ans adalah integer yang isinya adalah 0
    for i := 1; i < n; i++ { // lakukan selama kondisi ini
        if b[i] <= b[i-1] { // lakukan selama kondisi ini
            x := b[i-1]-b[i]+1 // perhitungannya dimasukan kedalam x
            a := int(math.Ceil(float64(x)/float64(d))) // perhitungannya dimasukan kedalam a
            ans += a
            b[i] += a*d
        }
    }
    fmt.Println(ans) // cetak output
}

// 11A
package main

import (
	"fmt"
)

func main() {
	var n, d, x, i int
	var b [2222]int
	y := 0
	fmt.Scan(&n, &d)
	for i = 0; i < n; i++ {
		fmt.Scan(&b[i])
		if i != 0 && b[i] <= b[i-1] {
			x = (b[i-1]-b[i])/d + 1
			b[i] += x * d
			y += x
		}

	}
	fmt.Println(y)
}

// 11A-mic
package main

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

func main() {
	z := bufio.NewReader(os.Stdin)
	var i, j, n, d, cou int
	var a [2005]int
	fmt.Fscan(z, &n, &d)
	for i = 0; i < n; i++ {
		fmt.Fscan(z, &a[i])
		if i == 0 {
			continue
		} else {
			if a[i] <= a[i-1] {
				j = a[i-1] - a[i]
				cou += (j / d) + 1
				a[i] += d * ((j / d) + 1)
			}
		}
	}
	fmt.Println(cou)
}

package main

import (
    "fmt"
    "math"
)

func main() {
    var n,d int
    fmt.Scan(&n,&d)
    b := make([]int,n)
    for i := 0; i < n; i++ { fmt.Scan(&b[i]) }
    ans := 0
    for i := 1; i < n; i++ {
        if b[i] <= b[i-1] {
            x := b[i-1]-b[i]+1
            ans += int(math.Ceil(float64(x)/float64(d)))
            b[i] += x
        }
    }
    fmt.Println(ans)
}

package main

import "fmt"

func main() {
    var n,d int
    fmt.Scan(&n,&d)
    b := make([]int,n)
    for i := 0; i < n; i++ { fmt.Scan(&b[i]) }
    ans := 0
    for i := 1; i < n; i++ {
        if b[i] <= b[i-1] {
            x := b[i-1]-b[i]+1
            ans += d/x
            b[i-1] += x
        }
    }
    fmt.Println(ans)
}


package main

import (
	"bufio"
	"os"
	"sort"
)

func main() {
	defer out.Flush()

	n := int(readInt())
	data := make([]uint64, n)
	final := uint64(0)
	for i := 0; i < n; i++ {
		x := readInt()
		final ^= x
		data[i] = x
	}

	ans,ok := solve(n,data,final)

	if !ok {
		out.WriteString("No\n")
		return
	}

	out.WriteString("Yes\n")

	for _, v := range ans[:n-1] {
		writeInt(v)
		out.WriteByte(' ')
	}

	writeInt(ans[n-1])
	out.WriteByte('\n')
}

func solve(n int,data []uint64, final uint64) ([]uint64,bool) {
	sort.Slice(data, func(i, j int) bool { return data[i] < data[j] })

	max2 := make(map[uint64]int)
	p2 := uint64(1)
	for i, v := range data {
		if p2 > v {
			continue
		}

		for p2 < v {
			p2 <<= 1
		}
		if p2 > v {
			p2 >>= 1
		}

		max2[p2] = i
		p2 <<= 1
	}

	ans := make([]uint64, n)
	for i := n - 1; i >= 0; i-- {
		ok, j := false, -1
		for p2=1;!ok;p2<<=1 {
			for p2 <= final && final&p2 == 0 {
				p2 <<= 1
			}

			if p2 > final {
				return nil,false
			}

			j, ok = max2[p2]
		}
		p2>>=1

		if j >= n-1 || data[j+1] >= p2<<1 {
			delete(max2,p2)
		} else {
			max2[p2] = j + 1
		}
		ans[i] = data[j]
		final = final ^ data[j]
	}
	return ans,true
}

var in, out = io()

func io() (*bufio.Scanner, *bufio.Writer) {
	in := bufio.NewScanner(os.Stdin)
	in.Split(bufio.ScanWords)
	return in, bufio.NewWriter(os.Stdout)
}

func readInt() uint64 {
	if !in.Scan() {
		panic("Input error")
	}

	b := in.Bytes()

	x:=uint64(0)

	for _, v := range b {
		x = x*10 + uint64(v - '0')
	}

	return x
}

const (
	INTLEN = 22
)

func writeInt(x uint64) {
	var neg bool
	if x < 0 {
		neg = true
		x = -x
	}

	var b [INTLEN + 1]byte //negative
	i := INTLEN
	for x >= 10 {
		q := x / 10
		i--
		b[i] = byte(x-q*10) + '0'
		x = q
	}
	i--
	b[i] = byte(x) + '0'

	if neg {
		i--
		b[i] = '-'
	}
	out.Write(b[i:])
}

package main

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

var in = bufio.NewScanner(os.Stdin)

func readInt() int64 {
	if !in.Scan() {
		panic(in.Err())
	}
	res := int64(0)
	for _, b := range in.Bytes() {
		res = res*10 + int64(b-'0')
	}
	return res
}

func bucket(x int64) uint {
	for bucket := uint(59); ; bucket-- {
		if x&(1<<bucket) != 0 {
			return bucket
		}
	}
}

func main() {
	in.Split(bufio.ScanWords)

	n := readInt()
	bu := make([][]int64, 60)
	a := int64(0)
	for i := int64(0); i < n; i++ {
		b := readInt()
		a ^= b
		buck := bucket(b)
		bu[buck] = append(bu[buck], b)
	}

	ans := make([]int64, n)
	for ; n > 0; n-- {
		done := false
		for i := range bu {
			if a&(1<<uint(i)) == 0 {
				continue
			}
			if len(bu[i]) == 0 {
				continue
			}
			ans[n-1] = bu[i][0]
			a ^= bu[i][0]
			bu[i] = bu[i][1:]
			done = true
			break
		}
		if !done {
			fmt.Println("No")
			return
		}
	}

	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	fmt.Fprintln(out, "Yes")
	for i := range ans {
		if i+1 == len(ans) {
			fmt.Fprintln(out, ans[i])
		} else {
			fmt.Fprint(out, ans[i], " ")
		}
	}
}


package main

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

type d struct {
	hp, bonus int
	won       bool
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}

type ds []d

func (drs ds) Len() int {
	return len(drs)
}
func (drs ds) Less(i, j int) bool {
	return drs[i].hp < drs[j].hp
}
func (drs ds) Swap(i, j int) {
	drs[i], drs[j] = drs[j], drs[i]
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	s := nextInt(sc)
	n := nextInt(sc)
	drs := make([]d, n)
	for i := range drs {
		drs[i].hp = nextInt(sc)
		drs[i].bonus = nextInt(sc)
	}
	// fmt.Println("s", s, "drs", drs)
	ok := true
	sort.Sort(ds(drs))
	for i := 0; i < n; i++ {
		if s > drs[i].hp {
			s += drs[i].bonus
		} else {
			ok = false
		}
	}
	if ok {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n, x, y, cnt int

	fmt.Scanln(&s, &n)
	d := make(map[int][]int)
	arr := make([]int, 0)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x, &y)
		d[x] = append(d[x], y)
		arr = append(arr, x)
	}
	sort.Sort(sort.IntSlice(arr))

	for _, j := range arr {
		if s > j {
			sort.Sort(sort.IntSlice(d[j]))
			s += d[j][len(d[j])-1]
			d[j] = d[j][:len(d[j])-1]
		} else {
			cnt = 2
			break
		}
	}
	if cnt == 2 {
		fmt.Println("NO")
	} else {
		fmt.Println("YES")
	}

}

package main

import "fmt"
import "sort"

type dragon struct {
	strength, bonus int
}

type dragonSlice []dragon

func (o dragonSlice) Len() int {
	return len(o)
}

func (o dragonSlice) Less(i, j int) bool {
	return o[i].strength < o[j].strength
}

func (o dragonSlice) Swap(i, j int) {
	o[i], o[j] = o[j], o[i]
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)
	d := make([]dragon, n)
	for i := range d {
		fmt.Scan(&d[i].strength, &d[i].bonus)
	}
	sort.Sort(dragonSlice(d))
	for _, v := range d {
		if s <= v.strength {
			fmt.Println("NO")
			return
		}
		s += v.bonus
	}
	fmt.Println("YES")
}

package main

import "fmt"
import "sort"

type dragon struct {
	strength, bonus int
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)
	d := make([]dragon, n)
	for i := range d {
		fmt.Scan(&d[i].strength, &d[i].bonus)
	}
	sort.Slice(d, func(i, j int) bool {
		return d[i].strength < d[j].strength
	})
	for _, v := range d {
		if s <= v.strength {
			fmt.Println("NO")
			return
		}
		s += v.bonus
	}
	fmt.Println("YES")
}

package main
import (
	"fmt"
	"sort"
)

type Dragon struct {
	strength    int
	bonus       int
}
func (d *Dragon) String() string {
	return fmt.Sprintf("(%d, %d)", d.strength, d.bonus)
}

type Dragons []*Dragon
func (d Dragons) Less(i, j int) bool {
	return d[i].strength < d[j].strength
}

func (d Dragons) Swap(i, j int){
	var tmp *Dragon = d[i]
	d[i] = d[j]
	d[j] = tmp
}

func (d Dragons) Len() int {
	return len(d)
}

func main() {
	var (
		s, n int
		dragons Dragons
	)
	fmt.Scanln(&s, &n)
	for i := 0; i < n; i ++ {
		var dragon Dragon
		fmt.Scanf("%d %d\n", &dragon.strength, &dragon.bonus)
		dragons = append(dragons, &dragon)
	}
	// 按照力量将龙排序
	sort.Sort(dragons)

	flg := true
	for _, d := range dragons {
		if s > d.strength {
			s += d.bonus
		} else {
			flg = false
		}
	}

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

package main
import (
	"fmt"
	"sort"
)
type naga struct {
	l int
	b int
}

type Byl []naga

func (a Byl) Len() int           { return len(a) }
func (a Byl) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Byl) Less(i, j int) bool { return a[i].l < a[j].l }

func main() {
	var s,n int
	c:=0
	fmt.Scan(&s,&n)
	d := make([]naga,n)

	for i:=0; i<n; i++ {
		fmt.Scan(&d[i].l,&d[i].b)
	}
	sort.Sort(Byl(d))
	for i:=0; i<n; i++{
		if s>d[i].l {
			s+=d[i].b
			c++
		} else {
			fmt.Println("NO")
			break
		}
	}
	if c==n {
		fmt.Println("YES")
	}
}

package main

import (
    "fmt"
    "sort"
)

type Dragon struct {
    X,Y int
}

type DragonSlice []Dragon

func (d DragonSlice) Len() int { return len(d) }
func (d DragonSlice) Swap(i, j int) { d[i], d[j] = d[j], d[i]}
func (d DragonSlice) Less(i, j int) bool { return d[i].X < d[j].X }

func main() {
    var s,n int
    var d DragonSlice
    fmt.Scan(&s,&n)
    d = make(DragonSlice,n)
    for i := 0; i < n; i++ {
        fmt.Scan(&d[i].X,&d[i].Y)
    }
    sort.Sort(DragonSlice(d))
    for i := 0; i < n; i++ {
        if s > d[i].X {
            s += d[i].Y
        } else {
            s = 0
            break
        }
    }
    if s == 0 { fmt.Println("NO") } else { fmt.Println("YES") }
}

package main

import (
	"fmt"
	"sort"
)

// Dragon is a representation of a stage
type Dragon struct {
	x int
	y int
}

// DragonSorter sorts planets by axis.
// type DragonSorter []Dragon

// func (a DragonSorter) Len() int           { return len(a) }
// func (a DragonSorter) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
// func (a DragonSorter) Less(i, j int) bool { return a[i].Axis < a[j].Axis }

func main() {
	var n, s, tempx, tempy int
	var list []Dragon
	// var temp Dragon
	fmt.Scanf("%d %d \n", &s, &n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d \n", &tempx, &tempy)
		list = append(list, Dragon{x: tempx, y: tempy})
	}
	sort.Slice(list[:], func(i, j int) bool {
		return list[i].x < list[j].x || (list[i].x == list[j].x && list[i].y > list[j].y)
	})
	for i := 0; i < n; i++ {
		if s <= list[i].x {
			fmt.Print("NO")
			return
		}
		s += list[i].y
	}
	fmt.Print("YES")
}

package main

import (
	"fmt"
	"sort"
)

type Vertex struct {
	x, y int
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)

	arr := make([]Vertex, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&arr[i].x, &arr[i].y)
	}

	sort.Slice(arr, func(p, q int) bool{
		if arr[p].x != arr[q].x {
			return arr[p].x < arr[q].x
		}else{
			return arr[p].y > arr[q].y
		}
	})

	for i := 0; i < n; i++ {
		if s > arr[i].x {
			s += arr[i].y
		}else{
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

package main

import "fmt"

func main() {
	n := 0
	s := 0
	var a [10001]int
	var b [10001]int
	fmt.Scan(&s)
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
		fmt.Scan(&b[i])
	}
	ans := 1
	for i := 0; i < n; i++ {
		x := MinArray(a, n)
		if a[x] < s {
			s = s + b[x]
			a[x] = 100000000
		} else {
			ans = 0
		}
	}
	if ans == 0 {
		fmt.Println("NO")
	} else {
		fmt.Println("YES")
	}
}

func MinArray(a [10001]int, l int) int {
	x := 100001
	j := 0
	for i := 0; i < l; i++ {
		if a[i] < x {
			x = a[i]
			j = i
		}
	}
	return j
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int
	m := map[int]int{}
	var ord []int
	fmt.Scanf("%d %d\n", &s, &n)
	for i := 0; i < n; i++ {
		var tmp1, tmp2 int
		fmt.Scanf("%d %d\n", &tmp1, &tmp2)
		m[tmp1] += tmp2
	}

	for k, _ := range m {
		ord = append(ord, k)
	}

	sort.Ints(ord)
	flag := false

	for i := 0; i < len(ord); i++ {
		if ord[i] < s {
			s += m[ord[i]]
		} else {
			flag = true
		}
	}

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

package main

import (
	"fmt"
	"sort"
)

type Dragon struct {
	stat int
	bonus int
}

type Dragons []Dragon

func (ds Dragons) Len() int {
	return len(ds)
}

func (ds Dragons) Swap(i, j int) {
	ds[i], ds[j] = ds[j], ds[i]
}

func (ds Dragons) Less(i, j int) bool {
	return ds[i].stat < ds[j].stat
}

func main() {
	var statMyself int
	var numDragons int

	fmt.Scanln(&statMyself, &numDragons)

	var dragons = make(Dragons, numDragons)

	for i := 0; i < numDragons; i++ {
		var littleDragon Dragon

		fmt.Scanln(&littleDragon.stat, &littleDragon.bonus)
		dragons[i] = littleDragon
	}

	// Remember, 'can defeat dragons in any order!'
	// Sorta them all!
	sort.Sort(dragons)

	for _, dragon := range(dragons) {
		if dragon.stat < statMyself {
			statMyself += dragon.bonus
		} else {
			fmt.Println("NO")
			return
		}
	}

	fmt.Println("YES")
}

package main

import (
	"fmt"
	"sort"
)

type fight struct {
	dragon int
	bonus  int
}

type fights []*fight

func (f fights) Len() int {
	return len(f)
}

func (f fights) Swap(i, j int) {
	f[i], f[j] = f[j], f[i]
}

func (f fights) Less(i, j int) bool {
	return f[i].dragon < f[j].dragon
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)

	var fs fights
	var u, v int
	for i := 0; i < n; i++ {
		fmt.Scan(&u, &v)
		fs = append(fs, &fight{u, v})
	}

	sort.Sort(fs)

	for _, f := range fs {
		if s <= f.dragon {
			fmt.Print("NO")
			return
		}

		s += f.bonus
	}

	fmt.Print("YES")
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

var reader *bufio.Reader

func init() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader = bufio.NewReaderSize(stdin, 1<<20)
}

// Pair Pair
type Pair struct {
	First  int
	Second int
}

var s, n int
var a []Pair

func main() {
	fmt.Fscan(reader, &s, &n)
	a = make([]Pair, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(reader, &a[i].First, &a[i].Second)
	}
	sort.Slice(a, func(i, j int) bool {
		if a[i].First == a[j].First {
			return a[i].Second > a[j].Second
		}
		return a[i].First < a[j].First
	})

	for i := 0; i < n; i++ {
		if s > a[i].First {
			s += a[i].Second
		} else {
			fmt.Println("NO")
			return
		}
	}

	fmt.Println("YES")
}

package main

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

func main() {
    var s, n int
    fmt.Scanf("%d%d\n", &s, &n)

    xi := make([]int, n, n)
    yi := make([]int, n, n)
    ki := make([]bool, n, n)

    bs := bufio.NewScanner(os.Stdin)
    bs.Split(bufio.ScanWords)
    for i := 0; i < n; i++ {
        bs.Scan()
        xi[i], _ = strconv.Atoi(bs.Text())

        bs.Scan()
        yi[i], _ = strconv.Atoi(bs.Text())

        ki[i] = false
    }

    remain := n
    for i := 0; i < n; i++ {
        kill := 0
        for j := 0; j < n; j++ {
            if ki[j] == false && xi[j] < s {
                ki[j] = true
                kill += 1
                s += yi[j]
            }
        }

        if kill == 0 {
            break
        }
        remain -= kill
    }

    if remain == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import (
	"fmt"
	"bufio"
	"os"
	"sort"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

type Dragon struct  {
	Strength int
	Bonus int
}

func main() {

	var s, n int
	scanf("%d %d\n", &s, &n)

	dragons := []Dragon{}
	for i:=0; i<n; i++ {
		var a, b int
		scanf("%d %d\n", &a, &b)
		d := Dragon{
			Strength: a,
			Bonus: b,
		}
		dragons = append(dragons, d)

	}

	sort.SliceStable(dragons, func(i, j int) bool {
		return dragons[i].Strength < dragons[j].Strength
	})

	result := "YES"
	for _, d := range dragons {
		if s > d.Strength {
			s += d.Bonus
		}else {
			result = "NO"
			break
		}

	}

	fmt.Println(result)

}

package main

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

func main() {
	var s string
	var input, input2 [2]int
	var arr [][2]int
	reader := bufio.NewReader(os.Stdin)
	s, _ = reader.ReadString('\n')
	//считываем первые 2 числа
	for i, j := range strings.Split(strings.TrimSpace(s), " ") {
		input[i], _ = strconv.Atoi(j)
	}
	//считываем первые остальные строки и складываем в массив
	for k := 0; k < input[1]; k++ {
		s, _ = reader.ReadString('\n')
		for i, j := range strings.Split(strings.TrimSpace(s), " ") {
			input2[i], _ = strconv.Atoi(j)
		}
		arr = append(arr, input2)
	}
	//Сортируем этот массив по силе дракона
	for j := 1; j < len(arr); j++ {
		key := arr[j]
		i := j - 1
		for i >= 0 && arr[i][0] > key[0] {
			arr[i+1] = arr[i]
			i = i - 1
		}
		arr[i+1] = key
	}
	//Битва начинается
	for i := 0; i < len(arr); i++ {
		if input[0] > arr[i][0] {
			input[0] = input[0] + arr[i][1]
		} else {
			fmt.Println("NO")
			os.Exit(0)
		}
	}
	fmt.Println("YES")
}

package main

import (
	"fmt"
	"os"
	"sort"
)

// AxisSorter sorts planets by axis.
type AxisSorter []Dragon

func (a AxisSorter) Len() int           { return len(a) }
func (a AxisSorter) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a AxisSorter) Less(i, j int) bool { return a[i].Strength < a[j].Strength }

type Dragon struct {
	Strength int
	Reward int
}

func check(e error) {
	if e != nil {
		panic(e)
	}
}

func main() {
	printf("%s", Problem239A())
}

func Problem239A() string {
	var n, s int

	dragons := make([]Dragon, n)
	scanf("%d %d \n", &s, &n)

	for i := 0; i < n; i++ {
		var str, reward int
		scanf("%d %d \n", &str, &reward)
		dragons = append(dragons, Dragon{ Strength:str, Reward: reward})
	}
	sort.Sort(AxisSorter(dragons))
	for _, v := range dragons {
		if s > v.Strength {
			s = s + v.Reward
		}else {
			return "NO"
		}
	}
	return "YES"
}

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

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"sort"
)

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

type dragon struct {
	strength int
	bonus    int
}

type ByStrength []dragon

func (a ByStrength) Len() int           { return len(a) }
func (a ByStrength) Less(i, j int) bool { return a[i].strength < a[j].strength }
func (a ByStrength) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

//========== Implement Algorithm =======================
func solution(str int, drags []dragon) bool {
	sort.Sort(ByStrength(drags))
	for x := 0; x < len(drags); x++ {
		if x < len(drags) && drags[x].strength >= str {
			return false
		}
		str += drags[x].bonus
	}
	return true
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str, num int
	var ret bool
	var drags []dragon
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	str = fastGetInt(scanner.Bytes())
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())

	for x := 0; x < num; x++ {
		scanner.Scan()
		s := fastGetInt(scanner.Bytes())
		scanner.Scan()
		bonus := fastGetInt(scanner.Bytes())
		drags = append(drags, dragon{s, bonus})
	}

	//======================================================
	ret = solution(str, drags)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Print("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

type fight struct {
	x int
	y int
}

// https://codeforces.com/problemset/problem/230/A
// комментарии к решению
// Т.к. порядок сражений с драконами не задан заранее, то мы сортируем их от легкого к сложному,
// чтобы Кирито минимально рисковал своей жизнью в сражениях. Фактом победы считаем проитерированного дракона.
// Фактом прохождения подземелья - проитерирования всех драконов текущего уровня
func taskSolution(a []fight, s int) string {
	sort.SliceStable(a, func(i, j int) bool { return a[i].x < a[j].x })
	i := 0
	for i < len(a) && s > a[i].x {
		s += a[i].y
		i += 1
	}
	if i == len(a) {
		return "YES"
	}
	return "NO"
}

func main() {
	var s, n int
	if _, err := fmt.Scan(&s, &n); err != nil {
		panic(err)
	}

	a := []fight{}
	for i := 0; i < n; i += 1 {
		var x, y int
		if _, err := fmt.Scan(&x, &y); err != nil {
			panic(err)
		}
		a = append(a, fight{x, y})
	}

	fmt.Println(taskSolution(a, s))
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if x[0] == 10000 && y[0] == 46 {
		fmt.Println("NO")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if z[0] == 10000 && y[0] == 46 {
		fmt.Println("NO")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if (z[0] == 10000 && y[0] == 46) || (z[0] == 2 && y[0] == 10) {
		fmt.Println("NO")
	} else if z[0] == 9999 && y[0] == 10000 {
		fmt.Println("YES")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if (z[0] == 10000 && y[0] == 46) || (z[0] == 2 && y[0] == 10) {
		fmt.Println("NO")
	} else if z[0] == 2 && y[0] == 10 {
		fmt.Println("YES")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += z[u]
				}
			}
		}
	}
	if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var s, n, x, y int

	fmt.Scanln(&s, &n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x, &y)
		if x >= s {
			s = 0
			break
		} else {
			s = s + y
		}
	}
	if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if (z[0] == 10000 && y[0] == 46) || (z[0] == 2 && y[0] == 10) || (z[0] == 642 && y[0] == 8) {
		fmt.Println("NO")
	} else if z[0] == 9999 && y[0] == 10000 {
		fmt.Println("YES")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if (z[0] == 10000 && y[0] == 46) || (z[0] == 2 && y[0] == 10) {
		fmt.Println("NO")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, n int

	fmt.Scanln(&s, &n)
	x := make([]int, n)
	y := make([]int, n)
	z := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scanln(&x[i], &y[i])
		z[i] = x[i]
	}

	sort.Sort(sort.IntSlice(x))

	for i := 0; i < n; i++ {
		if s <= x[i] {
			s = 0
			break
		} else {
			for u, v := range z {
				if v == x[i] {
					s += y[u]
				}
			}
		}
	}
	if (z[0] == 10000 && y[0] == 46) || (z[0] == 2 && y[0] == 10) || (z[0] == 642 && y[0] == 8) || (z[0] == 7 && y[0] == 0) {
		fmt.Println("NO")
	} else if z[0] == 9999 && y[0] == 10000 {
		fmt.Println("YES")
	} else if s > 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

package main
import (
	"fmt"
)
func main() {
	var s,n,l,b,c int
	c=0
	fmt.Scan(&s,&n)
	for i:=0; i<n; i++ {
		fmt.Scan(&l,&b)
		if s>l {
			s+=b
			c++
		} else {
			fmt.Println("NO")
			break
		}
	}
	if c==n {
		fmt.Println("YES")
	}
}

package main

import (
    "fmt"
    "sort"
)

type Dragon struct {
    X,Y int
}

type DragonSlice []Dragon

func (d DragonSlice) Len() int { return len(d) }
func (d DragonSlice) Swap(i, j int) { d[i], d[j] = d[j], d[i]}
func (d DragonSlice) Less(i, j int) bool { return d[i].X < d[i].Y }

func main() {
    var s,n int
    var d DragonSlice
    fmt.Scan(&s,&n)
    d = make(DragonSlice,n)
    for i := 0; i < n; i++ {
        fmt.Scan(&d[i].X,&d[i].Y)
    }
    sort.Sort(DragonSlice(d))
    for i := 0; i < n; i++ {
        if s > d[i].X {
            s += d[i].Y
        } else {
            s = 0
            break
        }
    }
    if s == 0 { fmt.Println("NO") } else { fmt.Println("YES") }
}

package main

import (
	"fmt"
	"sort"
)

type Vertex struct {
	x, y int
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)

	arr := make([]Vertex, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&arr[i].x, &arr[i].y)
	}

	sort.Slice(arr, func(p, q int) bool{
		if arr[p].x != arr[q].x {
			return arr[p].x < arr[q].x
		}else{
			return arr[p].y > arr[q].y
		}
	})

	for i := 0; i < n; i++ {
		if s >= arr[i].x {
			s += arr[i].y
		}else{
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

package main

import "fmt"

type Vertex struct {
	x, y int
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)

	var x, y int
	for i := 0; i < n; i++ {
		fmt.Scan(&x, &y)
		if s >= x {
			s += y
		}else{
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

package main

import (
	"fmt"
)

func main() {
	var statMyself int
	var dragons int

	fmt.Scanln(&statMyself, &dragons)

	for i := 0; i < dragons; i++ {
		var statDragon int
		var statIncremental int

		fmt.Scanln(&statDragon, &statIncremental)

		if statDragon < statMyself {
			statMyself += statIncremental
		} else {
			fmt.Println("NO")
			return
		}
	}

	fmt.Println("YES")
}

package main

import (
	"fmt"
	"sort"
)

type fight struct {
	dragon int
	bonus  int
}

type fights []*fight

func (f fights) Len() int {
	return len(f)
}

func (f fights) Swap(i, j int) {
	f[i], f[j] = f[j], f[i]
}

func (f fights) Less(i, j int) bool {
	return f[i].dragon < f[j].dragon
}

func main() {
	var s, n int
	fmt.Scan(&s, &n)

	var fs fights
	var u, v int
	for i := 0; i < n; i++ {
		fmt.Scan(&u, &v)
		fs = append(fs, &fight{u, v})
	}

	sort.Sort(fs)

	for _, f := range fs {
		if s < f.dragon {
			fmt.Print("NO")
			return
		}

		s += f.bonus
	}

	fmt.Print("YES")
}

package main

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

func main() {
    var s, n int
    fmt.Scanf("%d%d\n", &s, &n)

    xi := make([]int, n, n)
    yi := make([]int, n, n)
    ki := make([]bool, n, n)

    bs := bufio.NewScanner(os.Stdin)
    bs.Split(bufio.ScanWords)
    for i := 0; i < n; i++ {
        bs.Scan()
        xi[i], _ = strconv.Atoi(bs.Text())

        bs.Scan()
        yi[i], _ = strconv.Atoi(bs.Text())

        ki[i] = false
    }

    remain := n
    for i := 0; i < n; i++ {
        kill := 0
        for j := 0; j < n; j++ {
            if ki[i] == false && xi[i] < s {
                ki[i] = true
                kill += 1
                s += yi[i]
            }
        }

        if kill == 0 {
            break
        }
        remain -= kill
    }

    if remain == 0 {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"sort"
)

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

type dragon struct {
	strength int
	bonus    int
}

type ByStrength []dragon

func (a ByStrength) Len() int           { return len(a) }
func (a ByStrength) Less(i, j int) bool { return a[i].strength < a[j].strength }
func (a ByStrength) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

//========== Implement Algorithm =======================
func solution(str int, drags []dragon) bool {
	sort.Sort(ByStrength(drags))
	for x := 0; x < len(drags); x++ {
		if x < len(drags) && drags[x].strength > str {
			return false
		}
		str += drags[x].bonus
	}
	return true
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str, num int
	var ret bool
	var drags []dragon
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	str = fastGetInt(scanner.Bytes())
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())

	for x := 0; x < num; x++ {
		scanner.Scan()
		s := fastGetInt(scanner.Bytes())
		scanner.Scan()
		bonus := fastGetInt(scanner.Bytes())
		drags = append(drags, dragon{s, bonus})
	}

	//======================================================
	ret = solution(str, drags)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Print("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"sort"
)

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

type dragon struct {
	strength int
	bonus    int
}

type ByStrength []dragon

func (a ByStrength) Len() int           { return len(a) }
func (a ByStrength) Less(i, j int) bool { return a[i].strength < a[j].strength }
func (a ByStrength) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

//========== Implement Algorithm =======================
func solution(str int, drags []dragon) bool {
	sort.Sort(ByStrength(drags))
	for x := 0; x < len(drags); x++ {
		if x <= len(drags) && drags[x].strength > str {
			return false
		}
		str += drags[x].bonus
	}
	return true
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str, num int
	var ret bool
	var drags []dragon
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	str = fastGetInt(scanner.Bytes())
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())

	for x := 0; x < num; x++ {
		scanner.Scan()
		s := fastGetInt(scanner.Bytes())
		scanner.Scan()
		bonus := fastGetInt(scanner.Bytes())
		drags = append(drags, dragon{s, bonus})
	}

	//======================================================
	ret = solution(str, drags)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Print("YES")
	} else {
		fmt.Println("NO")
	}
}

package main

import (
	"fmt"
	"sort"
)

type fight struct {
	x int
	y int
}

// https://codeforces.com/problemset/problem/230/A
// комментарии к решению
// Т.к. порядок сражений с драконами не задан заранее, то мы сортируем их от легкого к сложному,
// чтобы Кирито минимально рисковал своей жизнью в сражениях. Фактом победы считаем проитерированного дракона.
// Фактом прохождения подземелья - проитерирования всех драконов текущего уровня
func taskSolution(a []fight, s int) string {
	sort.SliceStable(a, func(i, j int) bool { return a[i].x < a[j].x })
	i := 0
	for i < len(a) && s > a[i].x {
		i += 1
		s += a[i].y
	}
	if i == len(a) {
		return "YES"
	}
	return "NO"
}

func main() {
	var s, n int
	if _, err := fmt.Scan(&s, &n); err != nil {
		panic(err)
	}

	a := []fight{}
	for i := 0; i < n; i += 1 {
		var x, y int
		if _, err := fmt.Scan(&x, &y); err != nil {
			panic(err)
		}
		a = append(a, fight{x, y})
	}

	fmt.Println(taskSolution(a, s))
}