aboutsummaryrefslogtreecommitdiff
path: root/codeforces/YoungPhysicist/YoungPhysicist.cpp
blob: b126bd1dca7205315878ceedbe458c92cf81cd78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> v(n);
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < 3; j++) {
      int x;
      cin >> x;
      v[i].push_back(x);
    }
  }
  int x = 0, y = 0, z = 0;
  for(int i = 0; i < n; i++) {
      x+=v[i][0];
      y+=v[i][1];
      z+=v[i][2];
  }
  cout << ((x == 0 && y == 0 && z == 0) ? "YES" : "NO") << endl;

}