#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
    a[i].first *= 2;
    a[i].second *= 2;
  }
  if (n % 2) {
    cout << "NO";
    return 0;
  }
  long long x, y;
  x = (a[0].first + a[n / 2].first) / 2;
  y = (a[0].second + a[n / 2].second) / 2;
  vector<long long> q(n);
  for (long long i = 0; i < n; ++i) {
    long long d = (x - a[i].first) * (x - a[i].first) +
                  (y - a[i].second) * (y - a[i].second);
    q[i] = d;
  }
  bool ok = true;
  for (long long i = 0; i < n; ++i) {
    if (q[i] != q[(i + n / 2) % n]) {
      ok = 0;
    }
    if (2 * x != (a[i].first + a[(i + n / 2) % n].first)) ok = 0;
    if (2 * y != (a[i].second + a[(i + n / 2) % n].second)) ok = 0;
  }
  if (ok) {
    cout << "YES\n";
  } else {
    cout << "NO";
  }
}
