#include <bits/stdc++.h>
using namespace std;
long long x[100010], y[100010], len[100010];
double ang[100010];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  if (n & 1) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++) {
    int nx = (i + 1) % n;
    len[i] = (x[i] - x[nx]) * (x[i] - x[nx]) + (y[i] - y[nx]) * (y[i] - y[nx]);
  }
  for (int i = 0; i < n; i++) {
    int nx = (i + 1) % n, pv = (i + n - 1) % n;
    long long tmp =
        (x[pv] - x[nx]) * (x[pv] - x[nx]) + (y[pv] - y[nx]) * (y[pv] - y[nx]);
    ang[i] =
        1.0 * (len[pv] + len[i] - tmp) / (2.0 * sqrt(len[pv]) * sqrt(len[i]));
  }
  for (int i = 0; i < n; i++) {
    int t = (i + n / 2) % n;
    if (len[i] != len[t] || abs(ang[i] - ang[t]) >= 1e-5) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
}
