Problem: After the war, the supersonic rocket became the most common public transportation.

Each supersonic rocket consists of two "engines". Each engine is a set of "power sources". The first engine has n power sources, and the second one has m power sources. A power source can be described as a point (x_i, y_i) on a 2-D plane. All points in each engine are different.

You can manipulate each engine separately. There are two operations that you can do with each engine. You can do each operation as many times as you want.

  1. For every power source as a whole in that engine: (x_i, y_i) becomes (x_i+a, y_i+b), a and b can be any real numbers. In other words, all power sources will be shifted.
  2. For every power source as a whole in that engine: (x_i, y_i) becomes (x_i cos θ - y_i sin θ, x_i sin θ + y_i cos θ), θ can be any real number. In other words, all power sources will be rotated.



The engines work as follows: after the two engines are powered, their power sources are being combined (here power sources of different engines may coincide). If two power sources A(x_a, y_a) and B(x_b, y_b) exist, then for all real number k that 0 < k < 1, a new power source will be created C_k(kx_a+(1-k)x_b,ky_a+(1-k)y_b). Then, this procedure will be repeated again with all new and old power sources. After that, the "power field" from all power sources will be generated (can be considered as an infinite set of all power sources occurred).

A supersonic rocket is "safe" if and only if after you manipulate the engines, destroying any power source and then power the engine, the power field generated won't be changed (comparing to the situation where no power source erased). Two power fields are considered the same if and only if any power source in one field belongs to the other one as well.

Given a supersonic rocket, check whether it is safe or not.

Input

The first line contains two integers n, m (3 ≤ n, m ≤ 10^5) — the number of power sources in each engine.

Each of the next n lines contains two integers x_i and y_i (0≤ x_i, y_i≤ 10^8) — the coordinates of the i-th power source in the first engine.

Each of the next m lines contains two integers x_i and y_i (0≤ x_i, y_i≤ 10^8) — the coordinates of the i-th power source in the second engine.

It is guaranteed that there are no two or more power sources that are located in the same point in each engine.

Output

Print "YES" if the supersonic rocket is safe, otherwise "NO".

You can print each letter in an arbitrary case (upper or lower).

Examples

Input

3 4
0 0
0 2
2 0
0 2
2 2
2 0
1 1


Output

YES


Input

3 4
0 0
0 2
2 0
0 2
2 2
2 0
0 0


Output

NO

Note

The first sample:

<image> Those near pairs of blue and orange points actually coincide.

First, manipulate the first engine: use the second operation with θ = π (to rotate all power sources 180 degrees).

The power sources in the first engine become (0, 0), (0, -2), and (-2, 0).

<image>

Second, manipulate the second engine: use the first operation with a = b = -2.

The power sources in the second engine become (-2, 0), (0, 0), (0, -2), and (-1, -1).

<image>

You can examine that destroying any point, the power field formed by the two engines are always the solid triangle (0, 0), (-2, 0), (0, -2).

In the second sample, no matter how you manipulate the engines, there always exists a power source in the second engine that power field will shrink if you destroy it. 

Solution (in CPP):

Solution:
#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;
}