#include <bits/stdc++.h>

using namespace std;

typedef long long i64;
typedef unsigned long long ui64;
typedef vector<i64> vi;
typedef vector<vi> vvi;
typedef pair<i64, i64> pi;

#define pb push_back
#define sz(a) i64((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)
inline void RI(i64 &i) {scanf("%lld", &(i));}
inline void RVI(vi &v) { for(i64 i=0;i<sz(v);++i) { RI(v[i]); } }
inline void RVVI(vvi &vv) { for(i64 i=0;i<sz(vv);++i) { RVI(vv[i]); } }
inline void WI(const i64 &i) {printf("%lld\n", i);}
inline void WVI(const vi &v, char sep=' ') { for(i64 i=0;i<sz(v);++i) { if(i != 0){ printf("%c", sep); } printf("%lld", v[i]);} printf("\n"); }
inline void WS(const string &s) { printf("%s\n", s.c_str()); }
inline void WB(bool b, const string &yes, const string &no) { if(b){ WS(yes);} else { WS(no);} }
inline void YESNO(bool b) { WB(b, "YES", "NO"); }
inline void YesNo(bool b) { WB(b, "Yes", "No"); }
#define BUF_LENGTH 1000000
inline void RS(string &s) {static char buf[BUF_LENGTH]; scanf("%s", buf); s = buf;}
template<typename T> inline bool IN(T &S, const typename T::key_type &key) {
  return S.find(key) != S.end();
}
template<typename T> inline bool ON(const T &b, i64 idx) {
  return ((T(1) << idx) & b) != 0;
}

double sq(double d) {
  return d * d;
}

int main(int argc, char *argv[]) {
  i64 i, j, k;
  i64 N; RI(N);
  i64 Ma, Mb, Mc, Md;
  Ma = Mb = Mc = Md = 0;
  using ppi = pair<pi, pi>;
  vector<ppi> P(N);
  REP(0, N, i) {
    i64 a, b; RI(a); RI(b);
    a *= N;
    b *= N;
    Ma += a;
    Mb += b;
    P[i].first = {a, b};
  }
  REP(0, N, i) {
    i64 c, d; RI(c); RI(d);
    c *= N;
    d *= N;
    Mc += c;
    Md += d;
    P[i].second = {c, d};
  }
  Ma /= N;
  Mb /= N;
  Mc /= N;
  Md /= N;
  REP(0, N, i) {
    P[i].first.first -= Ma;
    P[i].first.second -= Mb;
    P[i].second.first -= Mc;
    P[i].second.second -= Md;
  }

  const double eps = 1e-3;

  if(N == 1) {
    WS("Yes");
    return 0;
  }

  i64 i0;
  REP(0, N, i0) {
    i64 a = P[i0].first.first;
    i64 b = P[i0].first.second;
    i64 n1 = a * a + b * b;
    if(n1 > 0) {
      break;
    }
  }
  assert(i0 != N);
  i64 a = P[i0].first.first;
  i64 b = P[i0].first.second;
  i64 n1 = a * a + b * b;
  REP(0, N, i) {
    i64 c = P[i].second.first;
    i64 d = P[i].second.second;

    i64 n2 = c * c + d * d;
    // cerr << n1 << " "<< n2 << endl;
    if(n1 != n2) {
      continue;
    }

    // cerr << a << " " << b << " " << c << " " << d << " " << endl;
    double r1 = atan2(b, a);
    double r2 = atan2(d, c);
    double delta = r2 - r1;
    double cd = cos(delta), sd = sin(delta);
    bool valid = true;
    // cerr << i << " " << delta << endl;
    REP(0, N, j) {
      i64 aa = P[j].first.first;
      i64 bb = P[j].first.second;
      double d_min = 1e10;
      double a2c = aa * cd - bb * sd;
      double b2d = bb * cd + aa * sd;
      REP(0, N, k) {
        i64 cc = P[k].second.first;
        i64 dd = P[k].second.second;
        double d = sq(cc - a2c) + sq(dd - b2d);
        d_min = min(d, d_min);
      }
      if(d_min > eps) {
        valid = false;
      }
    }
    if(valid) {
      WS("Yes");
      return 0;
    }
  }
  WS("No");
  return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#include <ctime>
#include <bitset>
// #include <atcoder/all>
#include <fstream>
#include <random>
#include <cassert>

//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;
// using namespace atcoder;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(ll i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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; }

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const double PI = 3.1415926535897932;

using Graph = vector<vector<ll>>;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << ketasitei;

	ll m, h;
	cin >> m >> h;

	if (h % m == 0) {
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}