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. 
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using std::abs;
using std::cerr;
using std::cin;
using std::cout;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::set;
using std::string;
using std::swap;
using std::vector;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using ld = long double;
template <typename T>
void _dbg(const char* _s, T _h) {
  cerr << _s << " = " << _h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* _s, T _h, Ts... _t) {
  int _b = 0;
  while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',') cerr << *_s++;
  cerr << " = " << _h << ",";
  _dbg(_s + 1, _t...);
}
struct init {
  init() {
    cin.tie(0);
    std::iostream::sync_with_stdio(0);
    cout << std::fixed << std::setprecision(10);
    cerr << std::fixed << std::setprecision(5);
  }
  ~init() {}
} init;
const int N = 1e5 + 1;
using myf = long long;
const myf EPS = 1e-10, PI = 3.1415926535897932384626433, MAXC = 1e9;
const bool FLOAT_GEOMETRY = std::is_floating_point<myf>::value;
inline bool less(myf a, myf b) { return a + EPS < b; }
inline bool greater(myf a, myf b) { return a > b + EPS; }
inline bool equal(myf a, myf b) {
  return abs(a - b) / max(myf(1), abs(a)) <= EPS;
}
inline bool neq(myf a, myf b) { return abs(a - b) / max(myf(1), abs(a)) > EPS; }
inline bool leq(myf a, myf b) { return less(a, b) || equal(a, b); }
inline bool geq(myf a, myf b) { return greater(a, b) || equal(a, b); }
struct point {
  myf x, y;
  point() {}
  point(myf _x, myf _y) : x(_x), y(_y) {}
  bool operator<(const point& rhs) const {
    return x == rhs.x ? y < rhs.y : x < rhs.x;
  }
  bool operator==(const point& rhs) const {
    return equal(x, rhs.x) && equal(y, rhs.y);
  }
};
inline myf dist(point a, point b) { return hypotl(b.x - a.x, b.y - a.y); }
inline myf sqdist(point a, point b) {
  return ((b.x - a.x) * (b.x - a.x)) + ((b.y - a.y) * (b.y - a.y));
}
inline bool btw(myf o, myf d1, myf d2) {
  return (less(d1, o) && less(o, d2)) || (less(d2, o) && less(o, d1));
}
inline bool btw(point o, point p1, point p2) {
  return btw(o.x, p1.x, p2.x) && btw(o.y, p1.y, p2.y);
}
std::istream& operator>>(std::istream& is, point& p) {
  return is >> p.x >> p.y;
}
std::ostream& operator<<(std::ostream& os, point& p) {
  return os << p.x << ' ' << p.y;
}
struct vc {
  myf x, y;
  vc() {}
  vc(myf _x, myf _y) : x(_x), y(_y) {}
  vc(point a, point b) {
    x = b.x - a.x;
    y = b.y - a.y;
  }
  myf length() { return hypotl(x, y); }
  myf sqlength() { return ((x) * (x)) + ((y) * (y)); }
};
point operator+(point a, vc v) { return point(a.x + v.x, a.y + v.y); }
vc operator+(vc a, vc v) { return vc(a.x + v.x, a.y + v.y); }
myf operator*(vc a, vc b) { return a.x * b.x + a.y * b.y; }
myf operator%(vc a, vc b) { return a.x * b.y - a.y * b.x; }
vc operator*(vc v, myf x) { return vc(v.x * x, v.y * x); }
vc turn_clockwise(vc a) { return vc(a.y, -a.x); }
vc turn_anticlockwise(vc a) { return vc(-a.y, a.x); }
struct line {
  myf a, b, c;
  line() {}
  line(myf _a, myf _b, myf _c) : a(_a), b(_b), c(_c) {
    if (FLOAT_GEOMETRY) normalize();
  }
  line(point one, point two) {
    a = one.y - two.y;
    b = two.x - one.x;
    c = -(a * one.x + b * one.y);
    if (FLOAT_GEOMETRY) normalize();
  }
  line(vc norm, point cont) {
    a = norm.x;
    b = norm.y;
    c = -(a * cont.x + b * cont.y);
    if (FLOAT_GEOMETRY) normalize();
  }
  void normalize() {
    myf div = hypotl(a, b);
    a /= div;
    b /= div;
    c /= div;
  }
  bool operator()(point p) { return equal(a * p.x + b * p.y + c, 0); }
};
struct circle {
  point center;
  myf radius;
  circle() {}
  circle(point _center, myf _radius) : center(_center), radius(_radius) {}
  circle(point _center, vc _v) : center(_center) { radius = _v.length(); }
  bool inside(point p) { return leq(dist(p, center), radius); }
  bool strict_inside(point p) { return less(dist(p, center), radius); }
  bool operator()(point p) { return equal(dist(p, center), radius); }
};
myf point_segment_dist(point O, point p1, point p2) {
  return (leq((vc(p1, O) * vc(p1, p2)) * (vc(p2, p1) * vc(p2, O)), 0))
             ? min(dist(O, p1), dist(O, p2))
             : abs((vc(O, p1) % vc(O, p2)) / dist(p1, p2));
}
myf det(myf a, myf b, myf c, myf d) { return a * d - b * c; }
int cross(line one, line two, point& p) {
  myf dx = det(one.c, one.b, two.c, two.b),
      dy = det(one.a, one.c, two.a, two.c),
      dd = det(one.a, one.b, two.a, two.b);
  if (equal(dx, 0) && equal(dy, 0) && equal(dd, 0))
    return 2;
  else if (equal(dd, 0))
    return 0;
  p = point(-dx / dd, -dy / dd);
  return 1;
}
int kasat(point A, circle C, point& p1, point& p2) {
  vc OA(C.center, A);
  myf l = OA.length();
  if (less(l, C.radius)) return 0;
  myf x = ((C.radius) * (C.radius)) / l;
  vc OP(OA.x * x / l, OA.y * x / l);
  point P = C.center + OP;
  myf hor = sqrtl(((C.radius) * (C.radius)) - OP.sqlength());
  p1 = P + turn_clockwise(OP * (hor / x));
  p2 = P + turn_anticlockwise(OP * (hor / x));
  return equal(l, C.radius) ? 1 : 2;
}
int cross(line l, circle c, point& p1, point& p2) {
  if (equal(l.b, 0)) {
    p1.x = -l.c / l.a;
    if (geq(((c.radius) * (c.radius)), ((p1.x) * (p1.x)))) {
      p2.x = p1.x;
      p1.y =
          c.center.y +
          sqrtl(max(myf(0), ((c.radius) * (c.radius)) -
                                ((c.center.x - p1.x) * (c.center.x - p1.x))));
      p2.y =
          c.center.y -
          sqrtl(max(myf(0), ((c.radius) * (c.radius)) -
                                ((c.center.x - p1.x) * (c.center.x - p1.x))));
      return equal(((c.radius) * (c.radius)),
                   ((c.center.x - p1.x) * (c.center.x - p1.x)))
                 ? 1
                 : 2;
    }
    return 0;
  }
  myf tt = (l.c + l.b * c.center.y) / l.b;
  myf ta = 1 + ((l.a / l.b) * (l.a / l.b)),
      tb = 2 * (tt * l.a / l.b - c.center.x),
      tc = ((tt) * (tt)) - ((c.radius) * (c.radius)) +
           ((c.center.x) * (c.center.x));
  myf td = ((tb) * (tb)) - 4 * ta * tc;
  if (less(td, 0)) return 0;
  p1.x = (-tb + sqrtl(max(myf(0), td))) / (2 * ta);
  p2.x = (-tb - sqrtl(max(myf(0), td))) / (2 * ta);
  p1.y = (-l.c - l.a * p1.x) / l.b;
  p2.y = (-l.c - l.a * p2.x) / l.b;
  return equal(td, 0) ? 1 : 2;
}
int cross(circle one, circle two, point& p1, point& p2) {
  if (equal(one.center.x, two.center.x) && equal(one.center.y, two.center.y))
    return equal(one.radius, two.radius) ? 3 : 0;
  line l(2 * (two.center.x - one.center.x), 2 * (two.center.y - one.center.y),
         ((one.center.x) * (one.center.x)) - ((two.center.x) * (two.center.x)) +
             ((one.center.y) * (one.center.y)) -
             ((two.center.y) * (two.center.y)) + ((two.radius) * (two.radius)) -
             ((one.radius) * (one.radius)));
  return cross(l, one, p1, p2);
}
bool inside_convex_polygon(const vector<point>& a, point p) {
  int n = a.size() - 1, l = 1, r = a.size() - 2;
  vc cur(a[0], p);
  if (less(vc(a[0], a[1]) % cur, 0) || less(cur % vc(a[0], a[n - 1]), 0))
    return false;
  while (r - l > 1) {
    int m = l + r >> 1;
    if (geq(cur % vc(a[0], a[m]), 0))
      r = m;
    else
      l = m;
  }
  return leq(vc(a[r], p) % vc(a[r], a[r + 1]), 0) &&
         leq(vc(a[r - 1], p) % vc(a[r - 1], a[r]), 0);
}
point ch_start;
bool ch_comp(const point& p1, const point& p2) {
  vc op1(ch_start, p1), op2(ch_start, p2);
  if (op1 % op2 == 0)
    return ((op1.x) * (op1.x)) + ((op1.y) * (op1.y)) <
           ((op2.x) * (op2.x)) + ((op2.y) * (op2.y));
  return op1 % op2 > 0;
}
vector<point> convex_hull(const vector<point>& p) {
  if (p.empty()) return {};
  ch_start = *std::min_element(p.begin(), p.end());
  vector<point> a;
  for (const point& i : p)
    if (i.x != ch_start.x || i.y != ch_start.y) a.emplace_back(i);
  sort(a.begin(), a.end(), ch_comp);
  if (a.empty()) return {ch_start};
  vector<point> ans = {ch_start, a[0]};
  for (uint i = 1; i < a.size(); ++i) {
    while (ans.size() >= 2 &&
           vc(ans[ans.size() - 2], ans.back()) % vc(ans.back(), a[i]) <= 0)
      ans.pop_back();
    ans.emplace_back(a[i]);
  }
  return ans;
}
bool check(vector<point> a, vector<point> b) {
  int n = a.size();
  for (int i = 1; i < n; ++i) {
    if (a[i].x - a[i - 1].x != b[i].x - b[i - 1].x ||
        a[i].y - a[i - 1].y != b[i].y - b[i - 1].y)
      return 0;
  }
  return 1;
}
vector<int> zfunc(const vector<ll>& s) {
  int n = s.size();
  vector<int> z(n, 0);
  int left = 0, right = 0;
  for (int i = 1; i < n; ++i) {
    if (i < right) z[i] = min(z[i - left], right - i);
    while ((i + z[i] < n) && (s[z[i]] == s[i + z[i]])) ++z[i];
    if (i + z[i] > right) {
      left = i;
      right = i + z[i];
    }
  }
  return z;
}
const ll INF = 1e18;
int main() {
  int n, m;
  cin >> n >> m;
  vector<point> a(n), b(m);
  for (auto& i : a) cin >> i;
  for (auto& i : b) cin >> i;
  a = convex_hull(a);
  b = convex_hull(b);
  for (auto i : a)
    ;
  for (auto j : b)
    ;
  if (a.size() != b.size()) {
    cout << "NO\n";
    return 0;
  }
  n = a.size();
  for (int i = 0; i < n; ++i) a.emplace_back(a[i]);
  a.emplace_back(a[0]);
  a.emplace_back(a[1]);
  vector<ll> order;
  b.emplace_back(b[0]);
  b.emplace_back(b[1]);
  for (int i = 0; i < n; ++i) {
    order.emplace_back(sqdist(b[i], b[i + 1]));
    vc v1(b[i + 1], b[i]);
    vc v2(b[i + 1], b[i + 2]);
    order.emplace_back(v1 % v2);
    order.emplace_back(v1 * v2);
  }
  order.emplace_back(INF);
  for (int i = 0; i < n + n; ++i) {
    order.emplace_back(sqdist(a[i], a[i + 1]));
    vc v1(a[i + 1], a[i]);
    vc v2(a[i + 1], a[i + 2]);
    order.emplace_back(v1 % v2);
    order.emplace_back(v1 * v2);
  };
  auto z = zfunc(order);
  ;
  for (int i = n * 3; i < order.size(); ++i) {
    if (z[i] == n * 3) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
