#include <bits/stdc++.h>
using namespace std;
int n;
struct Point {
  long long x, y;
};
bool check(Point A, Point B, Point C, Point D) {
  Point AB = {A.x - B.x, A.y - B.y};
  Point CD = {C.x - D.x, C.y - D.y};
  long long dist = AB.x * AB.x + AB.y * AB.y;
  long long dist1 = CD.x * CD.x + CD.y * CD.y;
  if (dist != dist1) {
    return false;
  }
  if (AB.x * CD.y - AB.y * CD.x != 0) {
    return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vector<Point> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i].x >> a[i].y;
  }
  if (n % 2 == 1) {
    cout << "NO";
    return 0;
  }
  int m = n / 2;
  for (int i = 1; i < m; i++) {
    Point A = a[i], B = a[i + 1];
    Point C = a[m + i], D = a[m + i + 1];
    if (!check(A, B, C, D)) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
