#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
set<pair<int, int> > st;
pair<int, int> p[maxn];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < (n); i++) {
    cin >> p[i].first >> p[i].second;
    if (i) {
      int x = p[i].first - p[i - 1].first;
      int y = p[i].second - p[i - 1].second;
      pair<int, int> tmp(-x, -y);
      if (st.count(tmp)) {
        st.erase(tmp);
      } else
        st.insert(make_pair(x, y));
    }
  }
  int x = p[0].first - p[n - 1].first;
  int y = p[0].second - p[n - 1].second;
  pair<int, int> tmp(-x, -y);
  if (st.count(tmp)) {
    st.erase(tmp);
  } else
    st.insert(make_pair(x, y));
  if (st.size())
    cout << "NO\n";
  else
    cout << "YES\n";
}
