#include <bits/stdc++.h>
using namespace std;
template <class Read>
void in(Read &x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    f |= (ch == '-');
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x = f ? -x : x;
  return;
}
int n;
long long a[100005], b[100005];
bool check() {
  if (n & 1) return 0;
  for (int i = 1; i <= n / 2; i++) {
    int j = i + n / 2;
    int id1 = i + 1;
    int id2 = j % n + 1;
    if ((b[i] - b[id1]) * (a[j] - a[id2]) != (b[j] - b[id2]) * (a[i] - a[id1]))
      return 0;
    long long x =
        (a[i] - a[id1]) * (a[i] - a[id1]) + (b[i] - b[id1]) * (b[i] - b[id1]);
    long long y =
        (a[j] - a[id2]) * (a[j] - a[id2]) + (b[j] - b[id2]) * (b[j] - b[id2]);
    if (x != y) return 0;
  }
  return 1;
}
int main() {
  in(n);
  for (int i = 1; i <= n; i++) {
    in(a[i]);
    in(b[i]);
  }
  if (check())
    puts("YES");
  else
    puts("NO");
  return 0;
}
