#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 1000002;
const double PI = 4 * atan(1);
const double eps = 1e-7;
const long long oo = 1e18;
long long n;
long long x[N];
long long y[N];
long long a[N];
long long b[N];
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  if (n % 2) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < n; i++) {
    x[i] = (a[(i + 1) % n] - a[i]);
    y[i] = (b[(i + 1) % n] - b[i]);
  }
  for (int i = 0; i < n / 2; i++) {
    if ((x[i] * y[i + n / 2] - x[i + n / 2] * y[i]) != 0) {
      cout << "NO\n";
      return 0;
    }
    if ((x[i] * x[i] + y[i] * y[i]) !=
        (x[i + n / 2] * x[i + n / 2] + y[i + n / 2] * y[i + n / 2])) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
