aboutsummaryrefslogtreecommitdiff
path: root/codeforces/YoungPhysicist/YoungPhysicist.cpp
blob: dc5056b61a23a659510d4261b7610d2d789a1132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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;
}