#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
bool dcmp(double x, double y = 0) { return fabs(x - y) <= EPS; }
double add(double a, double b) {
  if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
  return a + b;
}
struct P {
  double x, y;
  P() {}
  P(double x, double y) : x(x), y(y) {}
  P operator+(P p) { return P(add(x, p.x), add(y, p.y)); }
  P operator-(P p) { return P(add(x, -p.x), add(y, -p.y)); }
  P operator*(double d) { return P(x * d, y * d); }
  double dot(P p) { return add(x * p.x, y * p.y); }
  double det(P p) { return add(x * p.y, -y * p.x); }
};
vector<P> convex_hull(vector<P> &ps) {
  int n = ps.size();
  sort(ps.begin(), ps.end(), [](const P &a, const P &b) {
    return a.x != b.x ? a.x < b.x : a.y < b.y;
  });
  int k = 0;
  vector<P> qs(n << 1);
  for (int i = 0; i < n; i++) {
    while (k > 1 && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <= 0) {
      k--;
    }
    qs[k++] = ps[i];
  }
  for (int i = n - 2, t = k; i >= 0; i--) {
    while (k > t && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <= 0) {
      k--;
    }
    qs[k++] = ps[i];
  }
  qs.resize(k - 1);
  return qs;
}
double dis(P a, P b) {
  double x = a.x - b.x, y = a.y - b.y;
  return x * x + y * y;
}
struct V {
  long long x, y, z;
  bool operator<(const V &v) const {
    if (x != v.x) return x < v.x;
    if (y != v.y) return y < v.y;
    return z < v.z;
  }
  bool operator==(const V &v) const { return x == v.x && y == v.y && z == v.z; }
  bool operator!=(const V &v) const { return x != v.x || y != v.y || z != v.z; }
};
int kmp(vector<V> &p, vector<V> &t) {
  if (p.size() > t.size()) {
    return 0;
  }
  int lenp = p.size();
  vector<int> next(lenp + 1);
  for (int i = 1; i < lenp; i++) {
    int j = next[i];
    while (j && p[i] != p[j]) {
      j = next[j];
    }
    next[i + 1] = (p[i] == p[j] ? j + 1 : 0);
  }
  int res = 0, lent = t.size();
  for (int i = 0, j = 0; i < lent; i++) {
    while (j && t[i] != p[j]) {
      j = next[j];
    }
    if (t[i] == p[j]) {
      j++;
    }
    if (j == lenp) {
      res++;
    }
  }
  return res;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<P> a(n), b(m);
  for (int i = 0; i < n; i++) {
    scanf("%lf %lf", &a[i].x, &a[i].y);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lf %lf", &b[i].x, &b[i].y);
  }
  vector<P> ac = convex_hull(a), bc = convex_hull(b);
  int an = ac.size(), bn = bc.size();
  if (an != bn) {
    printf("NO\n");
  } else {
    vector<V> av(an << 1), bv(bn);
    for (int i = 0; i < an; i++) {
      long long x = dis(ac[i], ac[(i + 1) % an]);
      long long y = dis(ac[(i + 1) % an], ac[(i + 2) % an]);
      long long z = dis(ac[i], ac[(i + 2) % an]);
      av[i] = {x, y, z};
      av[an + i] = av[i];
    }
    for (int i = 0; i < bn; i++) {
      long long x = dis(bc[i], bc[(i + 1) % bn]);
      long long y = dis(bc[(i + 1) % bn], bc[(i + 2) % bn]);
      long long z = dis(bc[i], bc[(i + 2) % bn]);
      bv[i] = {x, y, z};
    }
    int ans = kmp(bv, av);
    printf("%s\n", ans ? "YES" : "NO");
  }
  return 0;
}
