#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const double eps = 1e-6;
const double pi = acos(-1.0);
double radToDeg(double theta) { return theta * 180.0 / pi; }
pair<double, double> toVec(pair<double, double>& a, pair<double, double>& b) {
  return pair<double, double>(b.first - a.first, b.second - a.second);
}
double dot(pair<double, double>& a, pair<double, double>& b) {
  return (a.first * b.first + a.second * b.second);
}
double norm_sq(pair<double, double>& v) {
  return v.first * v.first + v.second * v.second;
}
double angle(pair<double, double>& a, pair<double, double>& o,
             pair<double, double>& b) {
  pair<double, double> oa = toVec(o, a), ob = toVec(o, b);
  double ans = acos(dot(oa, ob) / sqrt(norm_sq(oa) * norm_sq(ob)));
  return radToDeg(ans);
}
double cross(pair<double, double>& a, pair<double, double>& b) {
  return a.first * b.second - a.second * b.first;
}
double cross(pair<double, double>& O, pair<double, double>& A,
             pair<double, double>& B) {
  return (A.first - O.first) * (B.second - O.second) -
         (A.second - O.second) * (B.first - O.first);
}
vector<pair<double, double> > convexHull(vector<pair<double, double> >& P) {
  int n = P.size(), k = 0;
  vector<pair<double, double> > H(2 * n);
  sort(P.begin(), P.end());
  for (int i = 0; i < n; i++) {
    while (k >= 2 && cross(H[k - 2], H[k - 1], P[i]) <= 0) k--;
    H[k++] = P[i];
  }
  for (int i = n - 2, t = k + 1; i >= 0; i--) {
    while (k >= t && cross(H[k - 2], H[k - 1], P[i]) <= 0) k--;
    H[k++] = P[i];
  }
  H.resize(k);
  return H;
}
double dist(pair<double, double>& p1, pair<double, double>& p2) {
  return hypot(p1.first - p2.first, p1.second - p2.second);
}
bool equal(const vector<double>& a, const vector<double>& b) {
  return fabs(a[0] - b[0]) < eps && fabs(a[1] - b[1]) < eps &&
         fabs(a[2] - b[2]) < eps;
}
int kmp(const vector<vector<double> >& T, const vector<vector<double> >& P) {
  if (P.empty()) return 0;
  vector<int> pi(P.size(), 0);
  for (int i = 1, k = 0; i < P.size(); ++i) {
    while (k && !equal(P[k], P[i])) k = pi[k - 1];
    if (equal(P[k], P[i])) ++k;
    pi[i] = k;
  }
  for (int i = 0, k = 0; i < T.size(); ++i) {
    while (k && !equal(P[k], T[i])) k = pi[k - 1];
    if (equal(P[k], T[i])) ++k;
    if (k == P.size()) return i - k + 1;
  }
  return -1;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<pair<double, double> > a(n, pair<double, double>(0, 0)),
      b(m, pair<double, double>(0, 0));
  for (int i = 0; i < n; i++) scanf("%lf%lf", &a[i].first, &a[i].second);
  for (int i = 0; i < m; i++) scanf("%lf%lf", &b[i].first, &b[i].second);
  vector<pair<double, double> > aconv = convexHull(a), bconv = convexHull(b);
  aconv.pop_back();
  bconv.pop_back();
  int aconv_size = aconv.size();
  for (int i = 0; i < aconv_size; i++) aconv.push_back(aconv[i]);
  vector<vector<double> > T, P;
  for (int i = 0; i < aconv.size(); i++) {
    int prev = i - 1, cur = i, next = i + 1;
    if (i == 0) prev = aconv.size() - 1;
    if (i == aconv.size() - 1) next = 0;
    vector<double> tmp;
    tmp.push_back(dist(aconv[prev], aconv[cur]));
    tmp.push_back(angle(aconv[prev], aconv[cur], aconv[next]));
    tmp.push_back(dist(aconv[cur], aconv[next]));
    T.push_back(tmp);
  }
  for (int i = 0; i < bconv.size(); i++) {
    int prev = i - 1, cur = i, next = i + 1;
    if (i == 0) prev = bconv.size() - 1;
    if (i == bconv.size() - 1) next = 0;
    vector<double> tmp;
    tmp.push_back(dist(bconv[prev], bconv[cur]));
    tmp.push_back(angle(bconv[prev], bconv[cur], bconv[next]));
    tmp.push_back(dist(bconv[cur], bconv[next]));
    P.push_back(tmp);
  }
  int index = kmp(T, P);
  if (index != -1) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
