#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <class T>
ostream& prnt(ostream& out, T v) {
  out << v.size() << '\n';
  for (auto e : v) out << e << ' ';
  return out;
}
template <class T>
ostream& operator<<(ostream& out, vector<T> v) {
  return prnt(out, v);
}
template <class T>
ostream& operator<<(ostream& out, set<T> v) {
  return prnt(out, v);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, map<T1, T2> v) {
  return prnt(out, v);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p) {
  return out << '(' << p.first << ' ' << p.second << ')';
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
const long double PI = acos(-1);
int n;
pair<int, int> v[500005];
int OK(pair<int, int> A, pair<int, int> B, pair<int, int> C, pair<int, int> D) {
  swap(C, D);
  int offX = C.first - A.first;
  int offY = C.second - A.second;
  if (D.first - B.first != offX || D.second - B.second != offY) return 0;
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  v[n + 1] = v[1];
  if (n % 2 == 1) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i <= n / 2; i++) {
    if (!OK(v[i], v[i + 1], v[i + n / 2], v[i + n / 2 + 1])) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
