#include <bits/stdc++.h>
using namespace std;
const int N = 300001;
struct po {
  int x, y;
  po operator-(po xx) const {
    xx.x = x - xx.x;
    xx.y = y - xx.y;
    return xx;
  }
  bool operator==(const po xx) const { return (x == xx.x) && (y == xx.y); }
} qwq[N];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &qwq[i].x, &qwq[i].y);
  }
  if (n % 2 == 1) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n / 2; i++) {
    if (!((qwq[i] - qwq[i + 1]) ==
          (qwq[i == n / 2 ? 1 : i + n / 2 + 1] - qwq[i + n / 2]))) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
}
