#include <bits/stdc++.h>
using namespace std;
void ECHO(string _s) { cout << _s; }
void ECHO(bool _s) { cout << _s; }
void ECHO(char _s) { cout << _s; }
void ECHO(int _s) { cout << _s; }
void ECHO(long long _s) { cout << _s; }
void ECHO(bitset<8> b) { cout << b; }
template <typename T>
void ECHO(set<T> _s) {
  for (auto el : _s) {
    ECHO(el);
    cout << "_";
  }
}
template <typename T1, typename T2>
void ECHO(map<T1, T2> _s) {
  for (auto el : _s) {
    ECHO(el);
    cout << "_";
  }
}
template <typename T1, typename T2>
void ECHO(pair<T1, T2> _s) {
  cout << "(";
  ECHO(_s.first);
  cout << ",";
  ECHO(_s.second);
  cout << ")";
}
template <typename T>
void ECHO(vector<T> v) {
  for (auto el : v) {
    ECHO(el);
    cout << "_";
  }
}
template <typename T, typename... Args>
void ECHO(string _s, T x, Args... args) {
  int _i, c = 0;
  for (_i = 0; _i < (int)_s.size(); _i++) {
    if (c == 0 && _s[_i] == ',') break;
    if (_s[_i] == '(') c++;
    if (_s[_i] == ')') c--;
  }
  cout << " (" << _s.substr(0, _i) << "): ";
  ECHO(x);
  while (_i < (int)_s.size() && (_s[_i] == ',' || _s[_i] == ' ')) _i++;
  ECHO(_s.substr(_i), args...);
}
const long double PI = acos(-1);
const long double eps = 1e-9;
const long long inf = LLONG_MAX / 10;
void fail() {
  cout << "NO\n";
  exit(0);
}
long long dist(pair<long long, long long> a, pair<long long, long long> b) {
  long long x1 = b.first - a.first;
  long long x2 = b.second - a.second;
  return x1 * x1 + x2 * x2;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, i;
  cin >> n;
  vector<pair<long long, long long> > v(n);
  for (i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
  if (n % 2) fail();
  for (i = 0; i <= n / 2 + 1; i++) {
    if ((v[(n / 2 + i) % n].first - v[(n / 2 + i + 1) % n].first) == 0 &&
        (v[i].first - v[(i + 1) % n].first) != 0)
      fail();
    if ((v[(n / 2 + i) % n].first - v[(n / 2 + i + 1) % n].first) != 0 &&
        (v[i].first - v[(i + 1) % n].first) == 0)
      fail();
    if ((v[i].second - v[(i + 1) % n].second) == 0 &&
        (v[(n / 2 + i) % n].second - v[(n / 2 + i + 1) % n].second) != 0)
      fail();
    if ((v[i].second - v[(i + 1) % n].second) != 0 &&
        (v[(n / 2 + i) % n].second - v[(n / 2 + i + 1) % n].second) == 0)
      fail();
    if ((v[i].second - v[(i + 1) % n].second) *
            (v[(n / 2 + i) % n].first - v[(n / 2 + i + 1) % n].first) !=
        (v[(n / 2 + i) % n].second - v[(n / 2 + i + 1) % n].second) *
            (v[i].first - v[(i + 1) % n].first))
      fail();
    if (dist(v[i], v[(i + 1) % n]) !=
        dist(v[(n / 2 + i) % n], v[(n / 2 + i + 1) % n]))
      fail();
  }
  cout << "YES\n";
  return 0;
}
