#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
void JIZZ(string output = "") {
  cout << output;
  exit(0);
}
const long double PI = 3.14159265358979323846264338327950288;
const long double eps = 1e-13;
long long mods[] = {1000000000 + 7,    1000000000 + 9,   1000000000 + 87,
                    1000000000 + 123,  1000000000 + 861, 1000000000 + 4329,
                    1000000000 + 25261};
long long prms[] = {7, 13, 47017};
long long mod1, mod2;
pair<long long, long long> dif(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>(a.first - b.first, a.second - b.second);
}
long long cr(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first * b.second - a.second * b.first;
}
pair<vector<pair<long long, long long>>, vector<pair<long long, long long>>>
doit(long long n) {
  vector<pair<long long, long long>> pt(n);
  for (auto &p : pt) cin >> p.first >> p.second;
  sort(pt.begin(), pt.end());
  long long tz = 0;
  vector<long long> tbm;
  auto usle = [&](pair<long long, long long> &a, pair<long long, long long> &b,
                  pair<long long, long long> &c) -> bool {
    return cr(dif(b, a), dif(c, a)) >= 0;
  };
  for (long long i = 0; i < n; ++i) {
    while (tz > 1 && usle(pt[tbm[tz - 1]], pt[i], pt[tbm[tz - 2]]))
      tbm.pop_back(), --tz;
    tbm.push_back(i);
    ++tz;
  }
  long long ttz = tz;
  for (long long i = n - 2; i >= 0; --i) {
    while (tz > ttz && usle(pt[tbm[tz - 1]], pt[i], pt[tbm[tz - 2]]))
      tbm.pop_back(), --tz;
    tbm.push_back(i);
    ++tz;
  }
  --tz;
  ;
  ;
  vector<pair<long long, long long>> tbp(tz);
  for (long long i = 0; i < tz; ++i) tbp[i] = pt[tbm[i]];
  ;
  ;
  for (pair<long long, long long> &p : tbp) p.first *= tz, p.second *= tz;
  long long xtt = 0, ytt = 0;
  for (pair<long long, long long> &p : tbp) xtt += p.first, ytt += p.second;
  xtt /= tz;
  ytt /= tz;
  ;
  ;
  vector<pair<long long, long long>> rt1(tz), rt2(tz);
  for (long long i = 0; i < tz; ++i) {
    long long dx = abs(tbp[i].first - xtt);
    long long dy = abs(tbp[i].second - ytt);
    auto doit2 = [&](long long p) -> long long {
      long long tdx = dx % p, tdy = dy % p;
      long long ddd = tdx * tdx + tdy * tdy;
      return ddd % p;
    };
    rt1[i].first = doit2(mod1);
    rt2[i].first = doit2(mod2);
  }
  for (long long i = 0; i < tz; ++i) {
    pair<long long, long long> p1 = tbp[i], p2 = tbp[i == tz - 1 ? 0 : i + 1];
    pair<long long, long long> d = dif(p2, p1);
    auto doit2 = [&](long long p) -> long long {
      long long tdx = abs(d.first) % p, tdy = abs(d.second) % p;
      long long ddd = tdx * tdx + tdy * tdy;
      return ddd % p;
    };
    rt1[i].second = doit2(mod1);
    rt2[i].second = doit2(mod2);
  };
  ;
  return make_pair(rt1, rt2);
}
bool ok(vector<pair<long long, long long>> &vap,
        vector<pair<long long, long long>> &vbp, const long long mod) {
  if (vap.size() != vbp.size()) return 0;
  long long len = vap.size();
  ;
  ;
  long long p = prms[rand() % 3];
  vector<long long> va(1 + len), vb(1 + len);
  for (long long i = 0; i < len; ++i) {
    va[i + 1] = (vap[i].first * 7122 + (vap[i].second ^ 7122)) % mod;
    vb[i + 1] = (vbp[i].first * 7122 + (vbp[i].second ^ 7122)) % mod;
  }
  vector<long long> ha(1 + len * 2), hb(1 + len), pp(1 + len * 2);
  pp[0] = 1;
  for (long long i = 1; i <= len * 2; ++i) pp[i] = pp[i - 1] * p % mod;
  for (long long i = 1; i <= len * 2; ++i)
    ha[i] = (ha[i - 1] + va[i > len ? i - len : i] * pp[i]) % mod;
  for (long long i = 1; i <= len; ++i)
    hb[i] = (hb[i - 1] + vb[i] * pp[i]) % mod;
  ;
  ;
  for (auto o = 0u; o < vb.size(); ++o) {
    if ((ha[o + len] - ha[o] + mod) % mod == (hb[len] * pp[o] % mod)) return 1;
  }
  return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(clock());
  long long n, m;
  cin >> n >> m;
  mod1 = mods[rand() % 7], mod2 = mods[rand() % 7];
  auto rn = doit(n);
  auto rm = doit(m);
  if (ok(rn.first, rm.first, mod1) && ok(rn.second, rm.second, mod2))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
