#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int maxn = 1e6 + 10;
const int mod = 1e9 + 7;
typedef struct p {
  long long x, y;
};
p a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld %lld", &a[i].x, &a[i].y);
  }
  int isok = 1;
  if (n % 2) {
    printf("NO\n");
    return 0;
  }
  for (int i = 0; i < n / 2; i++) {
    int a1 = i, b1 = i + 1, a2 = (i + n / 2 + n) % n,
        b2 = (i + n / 2 + n + 1) % n;
    if (abs(a[a1].x - a[b1].x) != abs(a[a2].x - a[b2].x) ||
        abs(a[a1].y - a[b1].y) != abs(a[a2].y - a[b2].y)) {
      isok = 0;
      break;
    }
  }
  if (isok)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
