#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inff = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
template <typename T>
inline T read(T& x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
const int maxn = 1e5 + 9;
pair<int, int> a[maxn];
bool check(int u, int v, int y, int x) {
  if (a[v].second - a[u].second != a[y].second - a[x].second) return false;
  if (a[v].first - a[u].first != a[y].first - a[x].first) return false;
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  if (n % 2) {
    puts("NO");
    return 0;
  }
  int flag = 1;
  for (int i = 1; i < n / 2; i++) {
    if (check(i, i + 1, i + n / 2, i + n / 2 + 1) == 0) flag = 0;
  }
  if (check(n / 2, n / 2 + 1, n, 1) == 0) flag = 0;
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
