#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
struct node {
  long long x, y;
} a[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lld%lld", &a[i].x, &a[i].y);
  int flag = 0;
  for (int i = 0; i < n; i++) {
    if (a[(i + 1) % n].x - a[i].x !=
        a[(i + n / 2) % n].x - a[(i + n / 2 + 1) % n].x)
      flag = 1;
    if (a[(i + 1) % n].y - a[i].y !=
        a[(i + n / 2) % n].y - a[(i + n / 2 + 1) % n].y)
      flag = 1;
  }
  if (flag)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
