#include <bits/stdc++.h>
using namespace std;
bool parralel(long long int x1, long long int y1, long long int x2,
              long long int y2, long long int x3, long long int y3,
              long long int x4, long long int y4) {
  long long int prod = (x2 - x1) * (y3 - y4) - (y2 - y1) * (x3 - x4);
  if (prod == 0) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  long long a = 1e9;
  long long z = a * 2 * a * 2 * 2;
  vector<long long int> x(N), y(N);
  for (int c = 0; c < N; c++) {
    cin >> x[c] >> y[c];
  }
  if (N % 2 == 1) {
    cout << "NO";
    return 0;
  }
  for (int c = 0; c < N; c++) {
    long long int x1 = x[c], y1 = y[c], x2 = x[(c + 1) % N],
                  y2 = y[(c + 1) % N];
    long long int x3 = x[(N / 2 + c) % N], y3 = y[(N / 2 + c) % N],
                  x4 = x[(N / 2 + c + 1) % N], y4 = y[(N / 2 + c + 1) % N];
    if (!parralel(x1, y1, x2, y2, x3, y3, x4, y4)) {
      cout << "NO";
      return 0;
    }
    if ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) !=
        (x3 - x4) * (x3 - x4) + (y3 - y4) * (y3 - y4)) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
