#include <bits/stdc++.h>
using namespace std;
int n, Ttest;
struct dl {
  int x, y;
};
dl a[212345], b[212345];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].x >> a[i].y;
  if (n % 2 == 0) {
    a[n + 1] = {a[1].x, a[1].y};
    for (int i = 1; i <= n; i++)
      b[i] = {a[i + 1].x - a[i].x, a[i + 1].y - a[i].y};
    n = n / 2;
    for (int i = 1; i <= n; i++)
      if (b[i].x != -b[i + n].x || b[i].y != -b[i + n].y) {
        cout << "NO";
        return 0;
      }
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
