#include <bits/stdc++.h>
using namespace std;
int n;
long long x[100000 + 10], y[100000 + 10];
int main() {
  scanf("%d", &n);
  if (n & 1) return printf("NO\n"), 0;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &x[i], &y[i]);
  }
  for (int i = 1; i < n / 2; i++) {
    if ((x[i + 1] - x[i]) * (y[i + 1 + n / 2] - y[i + n / 2]) !=
        (x[i + 1 + n / 2] - x[i + n / 2]) * (y[i + 1] - y[i]))
      return printf("NO\n"), 0;
    if (abs(x[i + 1] - x[i]) != abs(x[i + 1 + n / 2] - x[i + n / 2]))
      return printf("NO\n"), 0;
    if (abs(y[i + 1 + n / 2] - y[i + n / 2]) != abs(y[i + 1] - y[i]))
      return printf("NO\n"), 0;
  }
  if ((x[n] - x[1]) * (y[1 + n / 2] - y[n / 2]) !=
      (x[1 + n / 2] - x[n / 2]) * (y[n] - y[1]))
    return printf("NO\n"), 0;
  if (abs(x[n] - x[1]) != abs(x[1 + n / 2] - x[n / 2]))
    return printf("NO\n"), 0;
  if (abs(y[1 + n / 2] - y[n / 2]) != abs(y[n] - y[1]))
    return printf("NO\n"), 0;
  printf("YES\n");
  return 0;
}
