#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
struct point {
  double x, y;
  point() { x = y = 0.0; }
  point(double _x, double _y) : x(_x), y(_y) {}
  bool operator<(point other) const {
    if (fabs(x - other.x) > EPS) return x < other.x;
    return y < other.y;
  }
  bool operator==(point other) const {
    return (fabs(x - other.x) < EPS && fabs(y - other.y) < EPS);
  }
};
double dist(point p1, point p2) { return hypot(p1.x - p2.x, p1.y - p2.y); }
struct line {
  double a, b, c;
};
void pointsToLine(point p1, point p2, line &l) {
  if (fabs(p1.x - p2.x) < EPS) {
    l.a = 1.0, l.b = 0.0, l.c = -p1.x;
  } else {
    l.a = -(double)(p1.y - p2.y) / (p1.x - p2.x);
    l.b = 1.0;
    l.c = -(double)(l.a * p1.x) - p1.y;
  }
}
bool areParallel(line l1, line l2) {
  return (fabs(l1.a - l2.a) < EPS && (fabs(l1.b - l2.b) < EPS));
}
bool areSame(line l1, line l2) {
  return areParallel(l1, l2) && (fabs(l1.c - l2.c) < EPS);
}
struct vec {
  double x, y;
  vec(double _x, double _y) : x(_x), y(_y) {}
};
vec toVec(point a, point b) { return vec(b.x - a.x, b.y - a.y); }
vec scale(vec v, double s) { return vec(v.x * s, v.y * s); }
point translate(point p, vec v) { return point(p.x + v.x, p.y + v.y); }
double dot(vec a, vec b) { return (a.x * b.x + a.y * b.y); }
double norm_sq(vec v) { return v.x * v.x + v.y * v.y; }
double angle(point a, point o, point b) {
  vec oa = toVec(o, a), ob = toVec(o, b);
  return acos(dot(oa, ob) / sqrt(norm_sq(oa) * norm_sq(ob)));
}
bool same_double(double a, double b) { return (fabs(a - b) < EPS); }
int main() {
  vector<point> polygon;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    polygon.push_back(point(x * 1.0, y * 1.0));
  }
  if (n & 1) {
    cout << "NO\n";
  } else {
    bool ans = true;
    for (int i = 0; i < n / 2; i++) {
      if (!same_double(
              angle(polygon[i], polygon[i + 1], polygon[i + 2]),
              angle(polygon[(i + n / 2) % n], polygon[(i + n / 2 + 1) % n],
                    polygon[(i + n / 2 + 2) % n])))
        ans = false;
    }
    for (int i = 0; i < n / 2; i++) {
      if (!same_double(dist(polygon[i], polygon[i + 1]),
                       dist(polygon[i + n / 2], polygon[(i + n / 2 + 1) % n])))
        ans = false;
    }
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
