#include <bits/stdc++.h>
using Int = long long;  // clang-format off
using pii = std::pair<Int, Int>;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define RREP_(i, a_, b_, a, b, ...) for (Int i = Int(b) - 1, low##i = (a); i >= low##i; i--)
#define RREP(i, ...) RREP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) std::begin(v), std::end(v)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on
struct in {
    template <class T> operator T() {
        T t;
        std::cin >> t;
        return t;
    }
};
void out() { std::cout << "\n"; }
template <class Head, class... Tail> void out(Head&& h, Tail&&... t) {
    std::cout << h << (sizeof...(Tail) == 0 ? "" : " "), out(std::forward<Tail>(t)...);
}
template <class T> bool chmin(T& a, const T& b) { return a > b ? a = b, true : false; }
template <class T> bool chmax(T& a, const T& b) { return a < b ? a = b, true : false; }
template <class T> using V = std::vector<T>;

/**
 *    author:  knshnb
 *    created: Sun Jun 27 14:56:28 JST 2021
 **/

using comp = std::complex<double>;
double EPS = 1e-8;
bool equal(double a, double b) { return std::abs(a - b) < EPS; }
bool equal(comp a, comp b) { return std::abs(a - b) < EPS; }
bool set_equal(V<comp> a, V<comp> b) {
    for (comp x : a) {
        bool del = false;
        for (comp y : b) {
            if (equal(x, y)) {
                del = true;
                b.erase(std::find(ALL(b), y));
                break;
            }
        }
        if (!del) return false;
    }
    return true;
}
bool check(V<comp> a, V<comp> b, Int i, Int j) {
    Int n = a.size();
    comp dif1 = a[0], dif2 = b[i];
    REP(k, n) a[k] -= dif1, b[k] -= dif2;
    if (!equal(std::abs(a[1]), std::abs(b[j]))) return false;
    comp arg = a[1] / b[j];
    assert(equal(std::abs(arg), 1.));
    REP(k, n) b[k] *= arg;
    return set_equal(a, b);
}
signed main() {
    Int n = in();
    V<comp> s(n), t(n);
    REP(i, n) s[i].real(in()), s[i].imag(in());
    REP(i, n) t[i].real(in()), t[i].imag(in());
    if (n == 1) {
        out("Yes");
        return 0;
    }
    REP(i, n) {
        REP(j, n) {
            if (i == j) continue;
            if (check(s, t, i, j)) {
                out("Yes");
                return 0;
            }
        }
    }
    out("No");
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int N; cin >> N;
    vector<double> a(N),b(N),c(N),d(N);
    for(int _=0; _<2; _++){
        for(int i=0; i<N; i++) cin >> a[i] >> b[i];
        int x = 0, y = 0;
        for(int i=0; i<N; i++){
            x += a[i];
            y += b[i];
            a[i] *= N;
            b[i] *= N;
        }
        for(int i=0; i<N; i++){
            a[i] -= x;
            b[i] -= y;
        }
        swap(a,c);
        swap(b,d);
    }
    for(int i=0; i<N; i++){
        if(a[i]!=0 || b[i]!=0){
            swap(a[i],a[0]);
            swap(b[i],b[0]);
        }
    }
    string ans = "No";
    const double eps = 1e-6;
    for(int i=0; i<N; i++){
        double angle = atan2(d[i],c[i])-atan2(b[0],a[0]);
        bool flag = true;
        for(int j=0; j<N; j++){
            double A = a[j]*cos(angle)-b[j]*sin(angle);
            double B = a[j]*sin(angle)+b[j]*cos(angle);
            bool flag2 = false;
            for(int k=0; k<N; k++){
                if(std::abs(A-c[k])<=eps && std::abs(B-d[k])<=eps) flag2 = true;
            }
            flag &= flag2;
        }
        if(flag) ans = "Yes";
    }
    cout << ans << endl;
}
