#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6, pi = acos(-1.0);
inline int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
inline double sqr(double x) { return x * x; }
struct Point {
  double x, y;
  Point(double _x = 0, double _y = 0) : x(_x), y(_y){};
  inline void in() { scanf("%lf%lf", &x, &y); }
};
inline Point operator+(Point A, Point B) { return Point(A.x + B.x, A.y + B.y); }
inline Point operator-(Point A, Point B) { return Point(A.x - B.x, A.y - B.y); }
inline Point operator*(Point A, double p) { return Point(A.x * p, A.y * p); }
inline Point operator/(Point A, double p) { return Point(A.x / p, A.y / p); }
inline bool operator<(const Point &a, const Point &b) {
  return a.x < b.x || (a.x == b.x && a.y < b.y);
}
inline bool operator==(const Point &a, const Point &b) {
  return !dcmp(a.x - b.x) && !dcmp(a.y - b.y);
}
inline double Distance(Point A, Point B) {
  return sqrt(sqr(A.x - B.x) + sqr(A.y - B.y));
}
inline double Dot(Point A, Point B) { return A.x * B.x + A.y * B.y; }
inline double Norm(Point A) { return A.x * A.x + A.y * A.y; }
inline double Length(Point A) { return sqrt(Dot(A, A)); }
inline double GetAngle(Point A, Point B) {
  return acos(Dot(A, B) / Length(A) / Length(B));
}
inline double GetAngle(Point v) { return atan2(v.y, v.x); }
inline double Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
inline Point Unit(Point x) { return x / Length(x); }
inline Point Normal(Point x) { return Point(-x.y, x.x) / Length(x); }
inline Point Rotate(Point A, double rad) {
  return Point(A.x * cos(rad) - A.y * sin(rad),
               A.x * sin(rad) + A.y * cos(rad));
}
inline double Area2(const Point &A, const Point &B, const Point &C) {
  return Cross(B - A, C - A);
}
inline void getLineGeneralEquation(const Point &p1, const Point &p2, double &a,
                                   double &b, double &c) {
  a = p2.y - p1.y;
  b = p1.x - p2.x;
  c = -a * p1.x - b * p1.y;
}
inline Point GetLineIntersection(Point P, Point v, Point Q, Point w) {
  Point u = P - Q;
  double t = Cross(w, u) / Cross(v, w);
  return P + v * t;
}
inline double DistanceToLine(Point P, Point A, Point B) {
  Point v1 = B - A, v2 = P - A;
  return fabs(Cross(v1, v2)) / Length(v1);
}
inline double DistanceToSegment(Point P, Point A, Point B) {
  if (A == B) return Length(P - A);
  Point v1 = B - A, v2 = P - A, v3 = P - B;
  if (dcmp(Dot(v1, v2)) < 0)
    return Length(v2);
  else if (dcmp(Dot(v1, v3)) > 0)
    return Length(v3);
  else
    return fabs(Cross(v1, v2)) / Length(v1);
}
inline Point GetLineProjection(Point P, Point A, Point B) {
  Point v = B - A;
  return A + v * (Dot(v, P - A) / Dot(v, v));
}
inline bool SegmentProperIntersection(Point a1, Point a2, Point b1, Point b2) {
  double c1 = Cross(a2 - a1, b1 - a1), c2 = Cross(a2 - a1, b2 - a1);
  double c3 = Cross(b2 - b1, a1 - b1), c4 = Cross(b2 - b1, a2 - b1);
  return dcmp(c1) * dcmp(c2) < 0 && dcmp(c3) * dcmp(c4) < 0;
}
inline bool OnSegment(Point p, Point a1, Point a2) {
  return dcmp(Cross(a1 - p, a2 - p)) == 0 && dcmp(Dot(a1 - p, a2 - p)) < 0;
}
inline double PolygonArea(Point *p, int n) {
  double area = 0.0;
  for (int i = 1; i < n - 1; i++) area += Cross(p[i] - p[0], p[i + 1] - p[0]);
  return area / 2.0;
}
inline Point GetMidPoint(Point A, Point B) {
  return Point((A.x + B.x) / 2.0, (A.y + B.y) / 2.0);
}
inline int PointinPolygon(Point p, vector<Point> poly) {
  int n = poly.size(), flg = 0;
  for (int i = 0; i < n; i++) {
    if (OnSegment(p, poly[i], poly[(i + 1) % n])) return -1;
    int k = dcmp(Cross(poly[(i + 1) % n] - poly[i], p - poly[i]));
    int d1 = dcmp(poly[i].y - p.y);
    int d2 = dcmp(poly[(i + 1) % n].y - p.y);
    if (k > 0 && d1 <= 0 && d2 > 0) flg++;
    if (k < 0 && d2 <= 0 && d1 > 0) flg++;
  }
  if (flg) return 1;
  return 0;
}
struct Segment {
  Point p, v;
  Segment() {}
  Segment(Point _p, Point _v) : p(_p), v(_v) {}
  inline void in() {
    p.in();
    v.in();
  }
};
struct Line {
  Point p, v;
  double ang;
  Line() {}
  Line(Point _p, Point _v) : p(_p), v(_v) { ang = atan2(v.y, v.x); }
  inline Point point(double a) { return p + v * a; }
  inline bool operator<(const Line &rhs) const { return ang < rhs.ang; }
  inline Line move(double d) { return Line(p + Normal(v) * d, v); }
  inline void in() {
    p.in();
    v.in();
    ang = atan2(v.y, v.x);
  }
};
inline Line LineTransHorizon(Line l, int d) {
  Point vl = Normal(l.v);
  Point p1 = l.p + vl * d;
  return Line(p1, l.v);
}
inline Point GetLineIntersection(Line a, Line b) {
  return GetLineIntersection(a.p, a.v, b.p, b.v);
}
inline bool OnLeft(const Line &L, const Point &p) {
  return Cross(L.v, p - L.p) > 0;
}
inline Line GetParallel(Point p, Line l) { return Line(p, l.v); }
inline Line GetVertical(Point p, Line l) { return Line(p, Normal(l.v)); }
inline Point GetVerticalFoot(Point p, Line l) {
  return GetLineIntersection(GetVertical(p, l), l);
}
inline Line GetPerpendicularLine(Segment l) {
  return GetVertical(GetMidPoint(l.p, l.v - l.p), Line(l.p, l.v));
}
struct Angle {
  Point p, u, v;
  double ang;
  Angle() {}
  Angle(Point _p, Point _u, Point _v) : p(_p), u(_u), v(_v) {
    ang = GetAngle(u, v);
  }
  inline void in() {
    p.in();
    u.in();
    v.in();
    ang = GetAngle(u, v);
  }
};
inline int ConvexHull(Point *p, int n, Point *ans) {
  sort(p, p + n);
  int m = 0;
  for (int i = 0; i < n; i++) {
    while (m > 1 && Cross(ans[m - 1] - ans[m - 2], p[i] - ans[m - 2]) <= 0) m--;
    ans[m++] = p[i];
  }
  int k = m;
  for (int i = n - 2; ~i; i--) {
    while (m > k && Cross(ans[m - 1] - ans[m - 2], p[i] - ans[m - 2]) <= 0) m--;
    ans[m++] = p[i];
  }
  if (n > 1) m--;
  return m;
}
inline long long distan(Point p, Point q) {
  return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}
Point p[100005], q[100005], cp[200005], cq[200005];
int n, m, lx, ly, fail[100005];
long long dp[100005], dq[200005];
double ap[100005], aq[200005];
bool vis[100005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) p[i].in();
  for (int i = 0; i < m; ++i) q[i].in();
  lx = ConvexHull(p, n, cp);
  ly = ConvexHull(q, m, cq);
  if (lx != ly) return 0 * puts("NO");
  cp[lx] = cp[0], lx++;
  cp[lx] = cp[1];
  for (int i = 0; i < ly; ++i) cq[i + ly] = cq[i];
  ly <<= 1;
  cq[ly] = cq[0], ly++;
  cq[ly] = cq[1];
  for (int i = 1; i < lx; ++i) dp[i] = distan(cp[i], cp[i - 1]);
  for (int i = 1; i < ly; ++i) dq[i] = distan(cq[i], cq[i - 1]);
  for (int i = 1; i < lx; ++i)
    ap[i] = GetAngle(cp[i - 1] - cp[i], cp[i + 1] - cp[i]);
  for (int i = 1; i < ly; ++i)
    aq[i] = GetAngle(cq[i - 1] - cq[i], cq[i + 1] - cq[i]);
  fail[1] = 0;
  int j = 0;
  for (int i = 2; i < lx; ++i) {
    while (j && dp[i] != dp[j + 1]) j = fail[j];
    if (dp[i] == dp[j + 1]) j++;
    fail[i] = j;
  }
  j = 0;
  for (int i = 1; i < ly; ++i) {
    while (j && dq[i] != dp[j + 1]) j = fail[j];
    if (dq[i] == dp[j + 1]) j++;
    if (j == lx - 1) vis[i] = 1;
  }
  fail[1] = 0;
  j = 0;
  for (int i = 2; i < lx; ++i) {
    while (j && dcmp(ap[i] - ap[j + 1])) j = fail[j];
    if (!dcmp(ap[i] - ap[j + 1])) j++;
    fail[i] = j;
  }
  j = 0;
  for (int i = 1; i < ly; ++i) {
    while (j && dcmp(aq[i] - ap[j + 1])) j = fail[j];
    if (!dcmp(aq[i] - ap[j + 1])) j++;
    if (j == lx - 1)
      if (vis[i]) return 0 * puts("YES");
  }
  puts("NO");
  return 0;
}
