#include <bits/stdc++.h>
#define ll long long
#define ls id << 1
#define rs id << 1 | 1
#define mem(array, value, size, type) memset(array, value, ((size) + 5) * sizeof(type))
#define memarray(array, value) memset(array, value, sizeof(array))
#define fillarray(array, value, begin, end) fill((array) + (begin), (array) + (end) + 1, value)
#define fillvector(v, value) fill((v).begin(), (v).end(), value)
#define pb(x) push_back(x)
#define st(x) (1LL << (x))
#define pii pair<int, int>
#define mp(a, b) make_pair((a), (b))
#define Flush fflush(stdout)
#define vecfirst (*vec.begin())
#define veclast (*vec.rbegin())
#define vecall(v) (v).begin(), (v).end()
#define vecupsort(v) (sort((v).begin(), (v).end()))
#define vecdownsort(v, type) (sort(vecall(v), greater<type>()))
#define veccmpsort(v, cmp) (sort(vecall(v), cmp))
using namespace std;
const int N = 500050;
const int inf = 0x3f3f3f3f;
const ll llinf = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
clock_t TIME__START, TIME__END;
void program_end()
{
#ifdef ONLINE
    printf("\n\nTime used: %.6lf(s)\n", ((double)TIME__END - TIME__START) / 1000);
    system("pause");
#endif
}
int n;
int a[2005];
ll ans;
map<int, int> mpg;

inline void solve()
{
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> a[i];
    int g = a[1];
    for (int i = 1; i <= n; ++i)
        g = __gcd(a[i], g);
    for (int i = 1; i <= n; ++i)
        a[i] /= g;
    int mn = *min_element(a + 1, a + n + 1);
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j * j <= a[i]; ++j)
            if (a[i] % j == 0)
                mpg[j] = __gcd(mpg[j], a[i]), mpg[a[i] / j] = __gcd(mpg[a[i] / j], a[i]);
    for (auto i : mpg)
        ans += (i.first == i.second && i.first <= mn);
    cout << ans << endl;
}

int main()
{
    TIME__START = clock();
    int Test = 1;
    // scanf("%d", &Test);
    while (Test--)
    {
        solve();
        // if (Test)
        //     putchar('\n');
    }
    TIME__END = clock();
    program_end();
    return 0;
}
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); (i)++)
#define per(i, n) for (ll i = n - 1; i >= 0; (i)--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define ROF(i, a, b) for (ll i = (b) - 1; i >= (a); i--)
#define ALL(x) std::begin(x), std::end(x)
#define rALL(x) std::rbegin(x), std::rend(x)
#define fi first
#define se second
typedef long long ll;

// (x1, y1)と(x2, y2)の外積, 1->2で反時計回りなら正
inline ll ccw(ll x1, ll y1, ll x2, ll y2){
    ll res = x1 * y2 - x2 * y1;
    if(res == 0){ // 外積0のとき、同方向ならLLONG_MAX, 逆方向ならLLONG_MIN, 一方でも0なら0を返す
        ll a = x1 * x2 + y1 * y2;
        if(a > 0) return LLONG_MAX;
        else if(a < 0) return LLONG_MIN;
        else return 0;
    }
    return res;
}
inline ll norm2(ll x, ll y){ return x * x + y * y; }

int main(){
    //input, initialize
    ll N; cin >> N;
    vector<ll> a(N), b(N), c(N), d(N);
    //solve
    if(N == 1){ cout << "Yes"; return 0; }
    rep(i, N) cin >> a[i] >> b[i];
    rep(i, N) cin >> c[i] >> d[i];
    rep(i, N) { a[i] *= N; b[i] *= N; c[i] *= N; d[i] *= N; }

    ll c1x, c1y, c2x, c2y; c1x = c1y = c2x = c2y = 0;
    rep(i, N) { c1x += a[i]; c1y += b[i]; c2x += c[i]; c2y += d[i]; }
    c1x /= N; c1y /= N; c2x /= N; c2y /= N;
    rep(i, N) { a[i] -= c1x; b[i] -= c1y; c[i] -= c2x; d[i] -= c2y; }
    
    if(a[0] == 0 && b[0] == 0){
        swap(a[0], a[1]); swap(b[0], b[1]);
    }
    set<pair<ll, ll>> p1, p2; // 外積, ノルム2乗の順
    rep(i, N){
        p1.insert(make_pair(ccw(a[0], b[0], a[i], b[i]), norm2(a[i], b[i])));
    }
    rep(i, N){
        p2 = {};
        if(c[i] == 0 && d[i] == 0) continue;
        rep(j, N){
            p2.insert(make_pair(ccw(c[i], d[i], c[j], d[j]), norm2(c[j], d[j])));
        }
        if(p1 == p2) {cout << "Yes" << '\n'; return 0;}
    }
    //output
    cout << "No\n";
    //debug
}