#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> x(n + 1), y(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  if (n % 2) {
    cout << "NO" << endl;
    return 0;
  }
  x[n] = x[0];
  y[n] = y[0];
  for (int i = 1; i <= n / 2; i++) {
    int oth = (i + n / 2);
    if (oth > n) oth -= n;
    if (x[i] - x[i - 1] != x[oth - 1] - x[oth] or
        y[i] - y[i - 1] != y[oth - 1] - y[oth]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
