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