#include <bits/stdc++.h>
using namespace std;
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(long long &x, long long y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(long long &x, long long y) { return (y > x) ? x = y, 1 : 0; }
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const int MOD2 = 998244353;
const long double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;
namespace GEO {
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  long double len() { return sqrt(x * x + y * y); }
  long long len2() { return x * x + y * y; }
  void read() { cin >> x >> y; }
};
bool operator==(Point p1, Point p2) { return p1.x == p2.x && p1.y == p2.y; }
bool operator!=(Point p1, Point p2) { return p1.x != p2.x || p1.y != p2.y; }
Point operator+(Point p1, Point p2) { return Point(p1.x + p2.x, p1.y + p2.y); }
Point operator-(Point p1, Point p2) { return Point(p1.x - p2.x, p1.y - p2.y); }
long long operator*(Point p1, Point p2) { return p1.x * p2.x + p1.y * p2.y; }
long long operator%(Point p1, Point p2) { return p1.x * p2.y - p1.y * p2.x; }
long double dist(Point p1, Point p2) { return (p1 - p2).len(); }
long long dist2(Point p1, Point p2) { return (p1 - p2).len2(); }
vector<Point> convex_hull(vector<Point> a) {
  int pos_mi = min_element(a.begin(), a.end(),
                           [&](Point &p1, Point &p2) {
                             return p1.y != p2.y ? p1.y < p2.y : p1.x < p2.x;
                           }) -
               a.begin();
  swap(a[0], a[pos_mi]);
  sort(a.begin() + 1, a.end(), [&](Point &p1, Point &p2) {
    long long v = (p1 - a[0]) % (p2 - a[0]);
    return v != 0 ? v > 0 : (p1 - a[0]).len2() < (p2 - a[0]).len2();
  });
  vector<Point> hull;
  for (Point &p : a) {
    while ((int)hull.size() >= 2 &&
           (hull.back() - hull[(int)hull.size() - 2]) % (p - hull.back()) <= 0)
      hull.pop_back();
    hull.push_back(p);
  }
  return hull;
}
bool point_in_segment(Point a, Point b, Point p) {
  if ((b - a) % (p - a) != 0) return false;
  return ((b - a) * (p - a) >= 0 && (a - b) * (p - b) >= 0);
}
long double dist_point_to_segment(Point p, Point a, Point b) {
  if (a == b)
    return (a - p).len();
  else if ((b - a) * (p - a) >= 0 && (a - b) * (p - b) >= 0)
    return abs((a - p) % (b - p)) / (b - a).len();
  else
    return min((a - p).len(), (b - p).len());
}
bool SIS(Point a, Point b, Point c, Point d) {
  if ((b - a) % (d - c) == 0) {
    if (point_in_segment(a, b, c)) return true;
    if (point_in_segment(a, b, d)) return true;
    if (point_in_segment(c, d, a)) return true;
    if (point_in_segment(c, d, b)) return true;
    return false;
  } else {
    long long v1 = (b - a) % (c - a), v2 = (b - a) % (d - a);
    if (v1 < 0 && v2 < 0 || v1 > 0 && v2 > 0) return false;
    v1 = (d - c) % (a - c);
    v2 = (d - c) % (b - c);
    if (v1 < 0 && v2 < 0 || v1 > 0 && v2 > 0) return false;
    return true;
  }
}
bool point_in_triangle(Point a, Point b, Point c, Point p) {
  long long v1 = (b - a) % (p - a);
  long long v2 = (c - b) % (p - b);
  long long v3 = (a - c) % (p - c);
  return (v1 >= 0 && v2 >= 0 && v3 >= 0) || (v1 <= 0 && v2 <= 0 && v3 <= 0);
}
long long get_area2(vector<Point> &a, bool absolute) {
  int n = (int)a.size();
  long long res = 0;
  for (int i = (0); i < (n); i++) res += a[i] % a[(i + 1) % n];
  if (absolute) res = abs(res);
  return res;
}
bool check_counter_clockwise(vector<Point> &a) {
  return get_area2(a, false) > 0;
}
bool comp3(Point a, Point b) {
  if (a.y >= 0 && b.y < 0)
    return true;
  else if (a.y < 0 && b.y >= 0)
    return false;
  else if (a.y == 0 && b.y == 0)
    return a.x > b.x;
  else
    return a % b > 0;
}
vector<Point> minkovski(vector<Point> a, vector<Point> b) {
  a = convex_hull(a);
  b = convex_hull(b);
  vector<Point> p;
  for (int i = (0); i < ((int)a.size()); i++)
    p.push_back(a[(i + 1) % (int)a.size()] - a[i]);
  for (int i = (0); i < ((int)b.size()); i++)
    p.push_back(b[(i + 1) % (int)b.size()] - b[i]);
  sort(p.begin(), p.end(), comp3);
  vector<Point> res((int)p.size());
  res[0] = a[0] + b[0];
  for (int i = (0); i < ((int)p.size() - 1); i++) res[i + 1] = res[i] + p[i];
  res = convex_hull(res);
  return res;
}
}  // namespace GEO
long long gcd(long long x, long long y) {
  while (x) {
    y %= x;
    swap(x, y);
  }
  return y;
}
bool compare(vector<GEO::Point> &a, vector<GEO::Point> &a1) {
  if ((int)a.size() != (int)a1.size()) {
    return false;
  }
  int n = (int)a.size();
  long long v1 = -1, v2 = -1;
  for (int i = (0); i < (n); i++) {
    long long x1 = (a[(i + 1) % n] - a[i]).len2();
    long long x2 = (a1[(i + 1) % n] - a1[i]).len2();
    long long g = gcd(x1, x2);
    x1 /= g;
    x2 /= g;
    if (v1 != -1 && v2 != -1 && (v1 != x1 || v2 != x2)) {
      return false;
    }
    v1 = x1;
    v2 = x2;
  }
  for (int i = (0); i < (n); i++) {
    long long x1 = (a[(i + 1) % n] - a[i]) % (a[(i + 2) % n] - a[(i + 1) % n]);
    long long x2 =
        (a1[(i + 1) % n] - a1[i]) % (a1[(i + 2) % n] - a1[(i + 1) % n]);
    assert(x1 > 0 && x2 > 0);
    long long g = gcd(x1, x2);
    x1 /= g;
    x2 /= g;
    if (v1 != x1 || v2 != x2) {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  int n;
  cin >> n;
  vector<GEO::Point> a(n), a1(n);
  for (int i = (0); i < (n); i++) {
    int x, y;
    cin >> x >> y;
    a[i] = GEO::Point(x, y);
  }
  a = GEO::convex_hull(a);
  if ((int)a.size() % 2 != 0) {
    cout << "NO\n";
    return 0;
  }
  for (int i = (0); i < (n); i++) {
    GEO::Point p1 = a[(i + 1) % n] - a[i];
    GEO::Point p2 = a[(i + n / 2 + 1) % n] - a[(i + n / 2) % n];
    if (p1.len2() != p2.len2() || p1 % p2 != 0) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
