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;
long long read() {
  long long x = 0, y = 0, c = getchar();
  while (!isdigit(c)) y = c, c = getchar();
  while (isdigit(c)) x = x * 10 + (c ^ '0'), c = getchar();
  return y == '-' ? -x : x;
}
void print(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
long long s1 = 19260817, s2 = 23333333, s3 = 998244853, srd;
long long rd() { return srd = (srd * s1 + s2 + rand()) % s3; }
void file() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
int n, m;
struct node {
  long long x, y;
  node(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
} a[100010], b[100010], st1[100010], st2[100010], st3[100010], st4[100010];
int ft1, ft2, ft3, ft4;
node operator+(node q, node w) { return node(q.x + w.x, q.y + w.y); }
node operator-(node q, node w) { return node(q.x - w.x, q.y - w.y); }
bool operator<(node q, node w) { return q.x == w.x ? q.y < w.y : q.x < w.x; }
long long cj(node q, node w) { return q.x * w.y - q.y * w.x; }
long double q1[1000010], q2[1000010];
int p1, p2;
inline int cmp(long double q, long double w) {
  return abs(q - w) < 1e-10l ? 0 : q > w ? 1 : -1;
}
inline long double dis(node q, node w) {
  return sqrtl((q.x - w.x) * (q.x - w.x) + (q.y - w.y) * (q.y - w.y));
}
inline long long len(node q, node w) {
  return (q.x - w.x) * (q.x - w.x) + (q.y - w.y) * (q.y - w.y);
}
int qwq(long double *s, int l) {
  int i = 0, j = 1, k = 0;
  while (i < l && j < l) {
    k = 0;
    while (cmp(s[i + k], s[j + k]) == 0 && k < l) ++k;
    if (k == l) return i;
    if (cmp(s[i + k], s[j + k]) == 1) {
      if (i + k + 1 > j)
        i = i + k + 1;
      else
        i = j + 1;
    } else if (j + k + 1 > i)
      j = j + k + 1;
    else
      j = i + 1;
  }
  if (i < l) return i;
  return j;
}
int main() {
  srand(time(0));
  rd();
  int i, j;
  n = read();
  m = read();
  for (i = 1; i <= n; ++i) {
    a[i].x = read();
    a[i].y = read();
  }
  for (i = 1; i <= m; ++i) {
    b[i].x = read();
    b[i].y = read();
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  for (i = 1; i <= n; ++i) {
    while (ft1 > 1 && cj(a[i] - st1[ft1], st1[ft1 - 1] - st1[ft1]) >= 0) --ft1;
    st1[++ft1] = a[i];
  }
  for (i = n; i; --i) {
    while (ft2 > 1 && cj(a[i] - st2[ft2], st2[ft2 - 1] - st2[ft2]) >= 0) --ft2;
    st2[++ft2] = a[i];
  }
  for (i = 1; i <= m; ++i) {
    while (ft3 > 1 && cj(b[i] - st3[ft3], st3[ft3 - 1] - st3[ft3]) >= 0) --ft3;
    st3[++ft3] = b[i];
  }
  for (i = m; i; --i) {
    while (ft4 > 1 && cj(b[i] - st4[ft4], st4[ft4 - 1] - st4[ft4]) >= 0) --ft4;
    st4[++ft4] = b[i];
  }
  if (ft1 + ft2 != ft3 + ft4) {
    puts("NO");
    return 0;
  }
  if (ft1 == 2 && ft2 == 2) {
    if (len(st1[1], st1[2]) == len(st3[1], st3[2]))
      puts("YES");
    else
      puts("NO");
    return 0;
  }
  st1[0] = st2[ft2 - 1];
  st2[0] = st1[ft1 - 1];
  st3[0] = st4[ft4 - 1];
  st4[0] = st3[ft3 - 1];
  for (i = 1; i < ft1; ++i) {
    q1[p1++] = 1.0l * cj(st1[i] - st1[i + 1], st1[i] - st1[i - 1]) /
                   dis(st1[i], st1[i + 1]) / dis(st1[i], st1[i + 1]) -
               2;
    q1[p1++] = dis(st1[i], st1[i + 1]);
  }
  for (i = 1; i < ft2; ++i) {
    q1[p1++] = 1.0l * cj(st2[i] - st2[i + 1], st2[i] - st2[i - 1]) /
                   dis(st2[i], st2[i + 1]) / dis(st2[i], st2[i + 1]) -
               2;
    q1[p1++] = dis(st2[i], st2[i + 1]);
  }
  for (i = 1; i < ft3; ++i) {
    q2[p2++] = 1.0l * cj(st3[i] - st3[i + 1], st3[i] - st3[i - 1]) /
                   dis(st3[i], st3[i + 1]) / dis(st3[i], st3[i + 1]) -
               2;
    q2[p2++] = dis(st3[i], st3[i + 1]);
  }
  for (i = 1; i < ft4; ++i) {
    q2[p2++] = 1.0l * cj(st4[i] - st4[i + 1], st4[i] - st4[i - 1]) /
                   dis(st4[i], st4[i + 1]) / dis(st4[i], st4[i + 1]) -
               2;
    q2[p2++] = dis(st4[i], st4[i + 1]);
  }
  for (i = 0; i < p1; ++i) q1[i + p1] = q1[i];
  for (i = 0; i < p2; ++i) q2[i + p2] = q2[i];
  int l1 = qwq(q1, p1), l2 = qwq(q2, p2);
  for (i = 0; i < p1; ++i) {
    if (cmp(q1[l1], q2[l2])) {
      puts("NO");
      return 0;
    }
    ++l1;
    ++l2;
    if (l1 == p1) l1 = 0;
    if (l2 == p2) l2 = 0;
  }
  puts("YES");
  return 0;
}