#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
struct Point {
  long long x;
  long long y;
  Point() {
    x = 0LL;
    y = 0LL;
  }
  Point(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
};
struct Vector {
  long long x;
  long long y;
  Vector() {
    x = 0LL;
    y = 0LL;
  }
  Vector(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  Vector(Point p1, Point p2) {
    x = p2.x - p1.x;
    y = p2.y - p1.y;
  }
};
istream &operator>>(istream &in, Point &p) { return in >> p.x >> p.y; }
bool operator!=(const Vector &v1, const Vector &v2) {
  return v1.x != v2.x || v1.y != v2.y;
}
long long dot_product(Vector v1, Vector v2) {
  return v1.x * v2.x + v1.y * v2.y;
}
long long cross_product(Vector v1, Vector v2) {
  return v1.x * v2.y - v1.y * v2.x;
}
const int MAX_N = 100005;
int n;
Point points[MAX_N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> points[i];
  }
  if (n % 2 == 1) {
    cout << "NO";
    return 0;
  }
  for (int i = 0; i < n / 2 - 1; i++) {
    Vector v1 = Vector(points[i], points[i + 1]);
    Vector v2 = Vector(points[i + 1 + n / 2], points[i + n / 2]);
    if (v1 != v2) {
      cout << "NO";
      return 0;
    }
  }
  Vector v1 = Vector(points[n / 2 - 1], points[n / 2]);
  Vector v2 = Vector(points[0], points[n - 1]);
  if (v1 != v2) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
