#include <bits/stdc++.h>
const int maxn = 100000 + 5;
int x[maxn], y[maxn];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  if (n % 2 == 0) {
    bool can = true;
    for (int i = 1; i < n / 2 && can; i++) {
      if (x[i] - x[i + 1] != x[i + 1 + n / 2] - x[i + n / 2] ||
          y[i] - y[i + 1] != y[i + 1 + n / 2] - y[i + n / 2]) {
        can = false;
      }
    }
    if (can && x[n / 2] - x[n / 2 + 1] == x[1] - x[n] &&
        y[n / 2] - y[n / 2 + 1] == y[1] - y[n]) {
      puts("YES");
    } else {
      puts("NO");
    }
  } else {
    puts("NO");
  }
  return 0;
}
