#include <bits/stdc++.h>
using namespace std;
long long dis(pair<long long, long long> p1, pair<long long, long long> p2) {
  return (p1.first - p2.first) * (p1.first - p2.first) +
         (p1.second - p2.second) * (p1.second - p2.second);
}
bool lineLineIntersection(pair<long long, long long> A,
                          pair<long long, long long> B,
                          pair<long long, long long> C,
                          pair<long long, long long> D) {
  long long a1 = B.second - A.second;
  long long b1 = A.first - B.first;
  long long a2 = D.second - C.second;
  long long b2 = C.first - D.first;
  long long determinant = a1 * b2 - a2 * b1;
  return determinant == 0;
}
int main() {
  int t = 1;
  while (t--) {
    int n = ({
      int x;
      scanf("%d", &x);
      x;
    });
    vector<pair<long long, long long> > p(n);
    for (int i = (0); i < (n); i += (1)) {
      p[i].first = ({
        int x;
        scanf("%d", &x);
        x;
      });
      p[i].second = ({
        int x;
        scanf("%d", &x);
        x;
      });
    }
    if (n % 2) {
      cout << "NO\n";
      return 0;
    }
    for (int i = (0); i < (n / 2); i += (1)) {
      if (!lineLineIntersection(p[i], p[i + 1], p[n / 2 + i],
                                p[(n / 2 + i + 1) % n]) ||
          dis(p[i], p[i + 1]) != dis(p[n / 2 + i], p[(n / 2 + i + 1) % n])) {
        cout << "NO\n";
        return 0;
      }
    }
    cout << "YES\n";
  }
}
