#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
bool eq(long double a, long double b) { return abs(a - b) <= eps; }
bool neq(long double a, long double b) { return abs(a - b) > eps; }
bool gr(long double a, long double b) { return a - b > eps; }
bool le(long double a, long double b) { return b - a > eps; }
bool geq(long double a, long double b) { return a - b >= -eps; }
bool leq(long double a, long double b) { return b - a >= -eps; }
const long double pi = acos(-1), inf = 1 << 30;
struct Point {
  long double x, y;
  Point() : x(0), y(0) {}
  Point(long double x, long double y) : x(x), y(y) {}
  Point operator+(const Point &p) const { return Point(x + p.x, y + p.y); }
  Point operator-(const Point &p) const { return Point(x - p.x, y - p.y); }
  Point operator*(const long double &k) const { return Point(x * k, y * k); }
  Point operator/(const long double &k) const { return Point(x / k, y / k); }
  bool operator==(const Point &p) const { return eq(x, p.x) && eq(y, p.y); }
  bool operator!=(const Point &p) const { return !(*this == p); }
  bool operator<(const Point &p) const {
    return eq(x, p.x) ? le(y, p.y) : le(x, p.x);
  }
  bool operator>(const Point &p) const {
    return eq(x, p.x) ? gr(y, p.y) : gr(x, p.x);
  }
  long double norm() const { return sqrt(x * x + y * y); }
  long double dot(const Point &p) { return x * p.x + y * p.y; }
  long double cross(const Point &p) { return x * p.y - y * p.x; }
  Point perpendicularLeft() { return Point(-y, x); }
  Point perpendicularRight() { return Point(y, -x); }
  Point rotate(long double deg) {
    long double rad = (deg * pi) / 180.0;
    return Point(x * cos(rad) - y * sin(rad), x * sin(rad) + y * cos(rad));
  }
  Point unit() const { return (*this) / norm(); }
  Point projectOn(const Point &p) { return p.unit() * (dot(p) / p.norm()); }
  long double angleWith(const Point &p) {
    long double x = dot(p) / norm() / p.norm();
    return acos(max(-1.0L, min(1.0L, x)));
  }
  bool isPerpendicularWith(const Point &p) { return dot(p); }
  long double positionOf(const Point &p) { return cross(p); }
};
istream &operator>>(istream &is, Point &p) { return is >> p.x >> p.y; }
ostream &operator<<(ostream &os, const Point &p) {
  return os << "(" << p.x << ", " << p.y << ")";
}
void _main(int tc) {
  int n;
  cin >> n;
  if (n & 1) {
    cout << "NO" << '\n';
    return;
  }
  vector<Point> v(n);
  for (int i = 0; i < n; i += 1) {
    cin >> v[i];
  }
  vector<Point> edges(n);
  for (int i = 0; i < n; i += 1) {
    edges[i] = v[(i + 1) % n] - v[i];
  }
  for (int i = 0; i < n / 2 - 1; i += 1) {
    if (edges[i].norm() != edges[n / 2 + i].norm() ||
        edges[i].cross(edges[n / 2 + i])) {
      cout << "NO" << '\n';
      return;
    }
  }
  cout << "YES" << '\n';
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0);
  return 0;
  int tc;
  cin >> tc;
  for (int i = 0; i < tc; i += 1) _main(i + 1);
}
