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;
typedef long long Di;
typedef double D;
int DEFAULT_PREC = 6;
const D EPS = 1e-9, PI = acos((D)-1.0);
const Di INF = 1010101010101010101ll;
inline int cmp(double a) { return a > EPS ? 1 : a >= -EPS ? 0 : -1; }
inline int cmp(long double a) { return a > EPS ? 1 : a >= -EPS ? 0 : -1; }
inline int cmp(int a) { return a > 0 ? 1 : !a ? 0 : -1; }
inline int cmp(long long a) { return a > 0 ? 1 : !a ? 0 : -1; }
template <class T>
inline int cmp(T a, T b) {
  return cmp(a - b);
}
template <class T>
T sqr(T x) {
  return x * x;
}
inline void inputnum(double &p) { scanf("%lf", &p); }
inline void inputnum(long double &p) {
  double tmp;
  scanf("%lf", &tmp);
  p = tmp;
}
inline void inputnum(int &p) { scanf("%d", &p); }
inline void inputnum(long long &p) { scanf("%lld", &p); }
inline void outputnum(const double &p, int prec = DEFAULT_PREC) {
  printf("%.*f", prec, p);
}
inline void outputnum(const long double &p, int prec = DEFAULT_PREC) {
  printf("%.*f", prec, (double)p);
}
inline void outputnum(const int &p, int prec = DEFAULT_PREC) {
  printf("%d", p);
  if (prec)
    for (printf("."); prec--; printf("0"))
      ;
}
inline void outputnum(const long long &p, int prec = DEFAULT_PREC) {
  printf("%lld", p);
  if (prec)
    for (printf("."); prec--; printf("0"))
      ;
}
D safeacos(D x) {
  if (x <= -1) return PI;
  if (x >= 1) return 0;
  return acos(x);
}
class Point {
 public:
  Di x, y;
  Point() {}
  Point(Di x, Di y) : x(x), y(y) {}
  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  Point operator*(Di b) const { return Point(x * b, y * b); }
  Point operator/(Di b) const { return Point(x / b, y / b); }
  Point &operator+=(const Point &b) { return *this = *this + b; }
  Point &operator-=(const Point &b) { return *this = *this - b; }
  Point &operator*=(Di b) { return *this = *this * b; }
  Point &operator/=(Di b) { return *this = *this / b; }
  bool operator<(const Point &b) const {
    return cmp(x, b.x) == 0 ? cmp(y, b.y) < 0 : cmp(x, b.x) < 0;
  }
  bool operator>(const Point &b) const { return b < *this; }
  bool operator==(const Point &b) const {
    return cmp(x, b.x) == 0 && cmp(y, b.y) == 0;
  }
  bool operator<=(const Point &b) const { return !(*this > b); }
  bool operator>=(const Point &b) const { return !(*this < b); }
  bool operator!=(const Point &b) const { return !(*this == b); }
  Di len2() const { return x * x + y * y; }
  D len() const { return sqrt(len2()); }
  void read() {
    inputnum(x);
    inputnum(y);
  }
  void write(int prec = DEFAULT_PREC) const {
    printf("(");
    outputnum(x, prec);
    printf(",");
    outputnum(y, prec);
    printf(") ");
  }
  void writeln(int prec = DEFAULT_PREC) const {
    write(prec);
    printf("\n");
  }
  Point unit() const { return *this / len(); }
  Point &tounit() { return *this = *this / len(); }
  Point normal() const { return Point(-y, x); }
  Point symmetry(const Point &b) const { return b + b - *this; }
  D angle() const { return atan2(y, x); }
  Point rotate(const Point &b) const {
    return Point(x * b.x - y * b.y, x * b.y + y * b.x);
  }
  Point rotate(double b) const { return rotate(Point(cos(b), sin(b))); }
  Point &torotate(const Point &b) { return *this = rotate(b); }
  Point &torotate(double b) { return *this = rotate(b); }
};
Point operator*(Di b, const Point &a) { return Point(a.x * b, a.y * b); }
Point middle(const Point &a, const Point &b) { return (a + b) / 2; }
Di dot(const Point &a, const Point &b) { return a.x * b.x + a.y * b.y; }
Di det(const Point &a, const Point &b) { return a.x * b.y - a.y * b.x; }
bool in_triangle(const Point &a, const Point &b, const Point &c,
                 const Point &p) {
  return cmp(abs(det(a - p, b - p)) + abs(det(b - p, c - p)) +
                 abs(det(c - p, a - p)),
             abs(det(a - b, c - b))) == 0;
}
bool convex_tetragon(const Point &a, const Point &b, const Point &c,
                     const Point &d) {
  Di s[4] = {abs(det(a - b, a - c)), abs(det(b - c, b - d)),
             abs(det(c - d, c - a)), abs(det(d - a, d - b))};
  return cmp(s[0] + s[1] + s[2], s[3]) != 0 &&
         cmp(s[1] + s[2] + s[3], s[0]) != 0 &&
         cmp(s[2] + s[3] + s[0], s[1]) != 0 &&
         cmp(s[3] + s[0] + s[1], s[2]) != 0;
}
class Curve {
 public:
  virtual void read() {}
  virtual void write(int prec = DEFAULT_PREC) const {}
  void writeln(int prec = DEFAULT_PREC) const {
    write(prec);
    printf("\n");
  }
  virtual D len() const { return 0; }
};
class Line : public Curve {
 public:
  Point a, b;
  Line() {}
  Line(const Point &a, const Point &b) : a(a), b(b) {}
  bool operator<(const Line &l) const { return a == l.a ? b < l.b : a < l.a; }
  bool in_line(const Point &p) const { return cmp(det(p - a, p - b)) == 0; }
  virtual bool contain(const Point &p) const { return true; }
  void read() {
    a.read();
    b.read();
  }
  virtual void write(int prec = DEFAULT_PREC) const {
    a.write(prec);
    printf("-- ");
    b.write(prec);
  }
  virtual D len() const { return INF; }
};
class LineSegment : public Line {
 public:
  LineSegment() {}
  LineSegment(const Point &a, const Point &b) : Line(a, b) {}
  LineSegment(const Line &a) : Line(a) {}
  bool contain(const Point &p) const { return cmp(dot(p - a, p - b)) <= 0; }
  void write(int prec = DEFAULT_PREC) const {
    a.write(prec);
    printf("- ");
    b.write(prec);
  }
  D len() const { return (a - b).len(); }
};
class Ray : public Line {
 public:
  Ray() {}
  Ray(const Point &a, const Point &b) : Line(a, b) {}
  Ray(const Line &a) : Line(a) {}
  bool contain(const Point &p) const { return cmp(dot(p - a, b - a)) >= 0; }
  void write(int prec = DEFAULT_PREC) const {
    a.write(prec);
    printf("-> ");
    b.write(prec);
  }
};
int intersection(const Line &a, const Line &b, Point &o) {
  if (cmp(det(a.b - a.a, b.b - b.a)) == 0) return 0;
  Di s1 = det(b.b - a.a, b.a - a.a);
  Di s2 = det(b.a - a.b, b.b - a.b);
  o = a.a + (a.b - a.a) * s1 / (s1 + s2);
  return a.contain(o) && b.contain(o);
}
int intersection(const Line &a, const Line &b, Point &p1, Point &p2) {
  return intersection(a, b, p1);
}
Point projection(const Line &l, const Point &p) {
  return l.a + dot(p - l.a, l.b - l.a) * (l.b - l.a) / (l.b - l.a).len2();
}
Point symmetry(const Line &l, const Point &p) {
  return p.symmetry(projection(l, p));
}
int circumcenter(const Point &a, const Point &b, const Point &c, Point &o) {
  return intersection(Line(middle(a, b), middle(a, b) + (a - b).normal()),
                      Line(middle(b, c), middle(b, c) + (b - c).normal()), o);
}
vector<Point> convex_hull(vector<Point> vec) {
  if (vec.size() <= 1) return vec;
  sort(vec.begin(), vec.end());
  vector<Point> up, down;
  for (int i = 0; i < (int)vec.size(); i++) {
    while (up.size() >= 2 &&
           cmp(det(vec[i] - up.back(), *++up.rbegin() - up.back())) >= 0)
      up.pop_back();
    up.push_back(vec[i]);
    while (down.size() >= 2 &&
           cmp(det(vec[i] - down.back(), *++down.rbegin() - down.back())) <= 0)
      down.pop_back();
    down.push_back(vec[i]);
  }
  up.pop_back();
  reverse(up.begin(), up.end());
  up.pop_back();
  down.insert(down.end(), up.begin(), up.end());
  return down;
}
int n, m;
vector<Point> a, b;
int main() {
  scanf("%d%d", &n, &m);
  a.resize(n);
  b.resize(m);
  for (int i = 0; i < n; i++) a[i].read();
  for (int i = 0; i < m; i++) b[i].read();
  a = convex_hull(a);
  b = convex_hull(b);
  if (a.size() != b.size()) {
    printf("NO\n");
    return 0;
  }
  n = a.size();
  if (n == 2) {
    if ((a[1] - a[0]).len2() == (b[1] - b[0]).len2())
      printf("YES\n");
    else
      printf("NO\n");
    return 0;
  }
  a.push_back(a[0]);
  a.push_back(a[1]);
  b.insert(b.end(), b.begin(), b.end());
  b.push_back(b[0]);
  b.push_back(b[1]);
  for (int offset = 0; offset < n; offset++) {
    bool ok = true;
    for (int i = 0; i < n && ok; i++) {
      if ((a[i + 1] - a[i]).len2() !=
          (b[offset + i + 1] - b[offset + i]).len2())
        ok = false;
      if (det(a[i + 2] - a[i + 1], a[i] - a[i + 1]) !=
          det(b[offset + i + 2] - b[offset + i + 1],
              b[offset + i] - b[offset + i + 1]))
        ok = false;
    }
    if (ok) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}