#include <bits/stdc++.h>
using namespace std;
int x[100005], y[100005];
bool parallel(int p1, int p2, int p3, int p4) {
  if (x[p1] == x[p2] && x[p3] == x[p4])
    return true;
  else if (x[p1] == x[p2] || x[p3] == x[p4])
    return false;
  else
    return (1LL * (y[p1] - y[p2]) * (x[p3] - x[p4])) ==
           (1LL * (y[p3] - y[p4]) * (x[p1] - x[p2]));
}
long long dist(int p1, int p2) {
  return 1LL * (x[p1] - x[p2]) * (x[p1] - x[p2]) +
         1LL * (y[p1] - y[p2]) * (y[p1] - y[p2]);
}
int main() {
  int n, i, j;
  scanf("%d", &n);
  if (n % 2 == 1) {
    printf("NO\n");
    return 0;
  }
  for (i = 0; i < n; i++) scanf("%d%d", &x[i], &y[i]);
  x[n] = x[0];
  y[n] = y[0];
  for (i = 0; i < (n >> 1); i++) {
    j = i + (n >> 1);
    if (!parallel(i, i + 1, j, j + 1) || dist(i, i + 1) != dist(j, j + 1))
      break;
  }
  if (i >= (n >> 1))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
