#include <bits/stdc++.h>
using namespace std;
long long x[101000], y[101000];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &x[i], &y[i]);
  }
  x[0] = x[n], y[0] = y[n];
  x[n + 1] = x[1], y[n + 1] = y[1];
  for (int i = 1; i < 1 + n / 2; i++) {
    long long xx = x[i] - x[i + 1], yy = y[i] - y[i + 1];
    int id = i + n / 2;
    long long xxx = x[id + 1] - x[id], yyy = y[id + 1] - y[id];
    if (xx != xxx || yy != yyy) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
