#include <bits/stdc++.h>
using namespace std;
const long double eps = 0.0001;
const long double pi = acos(-1);
int dist(pair<int, int> a, pair<int, int> b) {
  return ((a.first - b.first) * (a.first - b.first) +
          (a.second - b.second) * (a.second - b.second));
}
bool f(pair<int, int> a, pair<int, int> b, pair<int, int> c, pair<int, int> d) {
  if ((abs(atan2(b.second - a.second, a.first - b.first) -
           atan2((d.second - c.second), (c.first - d.first))) < eps ||
       abs(abs(atan2((b.second - a.second), (a.first - b.first)) -
               atan2((d.second - c.second), (c.first - d.first))) -
           pi) < eps) &&
      dist(a, b) == dist(c, d)) {
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > p(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  p.push_back(p[0]);
  if (n % 2 == 1) {
    cout << "NO";
    return 0;
  }
  bool flag = true;
  for (int i = 0; i < n / 2; i++) {
    if (!f(p[i], p[i + 1], p[i + n / 2], p[i + n / 2 + 1])) {
      flag = false;
    }
  }
  if (flag) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
