/*
  Author     : MatsuTaku
  Date         : 06/26/21
  Certificate:
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAAAgQDF9T447OEo8XSQ6O1AznN5tKC8mzvYc4Zs3+oOKfMqgLXfOwQnpfcoxKs4MAP1eICBD13PkcIezJ9IlV6nKQZKs1BQmvjSXJ+zKK8YCKvAueNPuNO0Bim43IBaNHNFWcMvcmUvHgRb6hUSO0V8I7OsjiFo20KDBj3gAznu9tir0Q==
CompetitiveProgrammingCertification:tkm.matsumoto@gmail.com
*/

#include <bits/stdc++.h>
using namespace std;
#include <x86intrin.h>
#define REP(i, l, r)      for (int i = (l), i##_less = (r); i < i##_less; i++)
#define rep(i, n)         REP(i, 0, n)
#define RREP(i, l, r)     for (int i = (r)-1, i##_least = (l); i >= i##_least; i--)
#define rrep(i, n)        RREP(i, 0, n)
#define chmax(dst, x)     dst = max(dst, (x))
#define chmin(dst, x)     dst = min(dst, (x))
using lint = long long int;
using ulint = unsigned long long int;
template<typename T>
using vvec = vector<vector<T>>;
template<typename T>
vvec<T> make_vvec(int n, int m, T v) { return vvec<T>(n, vector<T>(m, v)); }

class Solver {
 public:
  Solver();
  void solve();
};

Solver::Solver() {}

constexpr double EPS = 1e-6;
void Solver::solve() {
  int n; cin>>n;
  vector<pair<int,int>> P(n), Q(n);
  int pgx = 0, pgy = 0, qgx = 0, qgy = 0;
  rep(i, n) {
    int a,b; cin>>a>>b;
    P[i] = {a*n,b*n};
    pgx += a;
    pgy += b;
  }
  rep(i, n) {
    P[i].first -= pgx;
    P[i].second -= pgy;
  }
  rep(i, n) {
    int c,d; cin>>c>>d;
    Q[i] = {c*n,d*n};
    qgx += c;
    qgy += d;
  }
  rep(i, n) {
    Q[i].first -= qgx;
    Q[i].second -= qgy;
  }

  if (n == 1) {
    cout << "Yes" << endl;
    return;
  }

  int z = 0;
  if (abs(P[z].first) < EPS and abs(P[z].second) < EPS)
    z++;
  rep(i, n) {
    auto [a,b] = P[z];
    auto [c,d] = Q[i];
    double ang_p = atan2(b, a);
    double ang_q = atan2(d, c);
    double ang = ang_p - ang_q;
    double cos_qp = cos(ang);
    double sin_qp = sin(ang);
    bool ans = true;
    rep(j, n) {
      auto [qx,qy] = Q[j];
      double x = cos_qp * qx - sin_qp * qy;
      double y = sin_qp * qx + cos_qp * qy;
      bool ok = false;
      for (auto [px,py] : P) {
        ok |= abs(px-x) < EPS and abs(py-y) < EPS;
      }
      ans &= ok;
    }
    if (ans) {
      cout << "Yes" << endl;
      return;
    }
  }
  cout << "No" << endl;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(10);
  Solver solver;
  int t = 1;
//  cin>>t;
  while (t--) {
    solver.solve();
  }
  return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

//#define DEBUG_ //!!$BDs=P;~$K%3%a%s%H%"%&%H(B!!
#ifdef DEBUG_
#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

    template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int mod = 1e9+7;
//const int mod = 998244353;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
const long double PI = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899;
int dx[] = {0,0,-1,1};
int dy[] = {-1,1,0,0};

LL N,K;
bool check(LL mid){
    LL acc = (mid) * (mid-1) / 2 * (mid-2) / 3;
    LL A = (mid-N-1) * (mid-N-2) / 2;
    chmax(A,0LL);
    LL B = (mid-2*N-1) * (mid-2*N-2) / 2;
    chmax(B,0LL);
    LL C = A*3 - B*3;
    acc = acc - C;


    if(acc >= K){
        return true;
    }else{
        return false;

    }
}

__int128 calc_acc(LL mid){

    __int128 acc = __int128(mid) * (mid-1) / 2 * (mid-2) / 3;
    //dump(acc)
    __int128 A = 0;
    if(mid-N-3 >= 0){
        A = __int128(mid-N) * (mid-N-1) / 2 * (mid-N-2) / 3;
    }

    __int128 B = 0;
    if(mid-2*N-3 >= 0){
        B = __int128(mid-2*N) * (mid-2*N-1) / 2 * (mid-2*N-2) / 3;
    }
    __int128 C = A*3 - B*3;
    acc = acc - C;

    //return LL(acc);
    return acc;

}

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);

    cin >> N >> K;
    __int128 K1 = K;
    LL left = 2, right = 3*N;
    while(abs(left-right) > 1){
        LL mid = (left + right) / 2;
       
        __int128 acc = calc_acc(mid);
        //dump(mid)
        //dump(acc)
        if(acc >= K1){
            right = mid;
        }else{
            left = mid;
        }
    }

    //LL acc = (left) * (left-1) / 2 * (left-2) / 3;
    __int128 acc = calc_acc(left);
    LL sum = right;

    dump(left)
    dump(right)


    for(LL i = 1; i <= N; i++){
        dump(i)
        LL sj = max(1LL,sum-i-N);
        LL mj = min(N,sum-i-1);
        dump(sj)
            dump(mj)
        LL add = max(0LL,(mj-sj)+1);
        dump(add)
        if(acc + add < K){
            acc += add;
        }else{
            LL rem = K - acc;
            LL stj = max(1LL,sum-N-i);
            LL j = stj + rem-1;
            LL k = sum - i - j;

            cout << i << " "  << j << " " << k << endl;
            break;
        }
    }

    //dump(calc_acc(3*N));
}