#include <bits/stdc++.h>
using namespace std;
void sout() { cout << endl; }
template <typename T, typename... Types>
void sout(T var1, Types... var2) {
  cout << var1 << " ";
  sout(var2...);
}
void solve() {
  int n;
  cin >> n;
  int sumx = 0, sumy = 0, sumz = 0;
  for (int i = 0; i < n; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    sumx += x;
    sumy += y;
    sumz += z;
  }
  if (sumx == sumy and sumy == sumz and sumx % n == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  clock_t t1 = clock();
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  cerr << "Time elapsed: " << (double)(clock() - t1) / 1000 << " s" << endl;
}
