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>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int INF = 2147483647;
const int mod = 1000000007;
const int mod2 = 998244353;
const double eps = 1e-9;
const double pi = acos(-1.0);
inline int rint() {
  int x;
  scanf("%d", &x);
  return x;
}
inline long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline long long ri64() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
void rvi(vector<int> &a, int n) {
  for (int i = 0; i < n; i++) {
    a.push_back(rint());
  }
}
void rvll(vector<long long> &a, int n) {
  for (int i = 0; i < n; i++) {
    a.push_back(rll());
  }
}
void showvi(vector<int> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%d%c", a[i], (i + 1 == a.size() ? '\n' : ' '));
  }
}
void showvll(vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%lld%c", a[i], (i + 1 == a.size() ? '\n' : ' '));
  }
}
void showviln(vector<int> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%d%c", a[i], '\n');
  }
}
void showvllln(vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%lld%c", a[i], '\n');
  }
}
void showi(int x) { printf("%d", x); }
long long pw(long long a, long long b, long long c) {
  long long ans = 1;
  long long k = a % c;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * k) % c;
    b = b / 2;
    k = (k * k) % c;
  }
  return ans;
}
const int maxn = 100011;
struct node {
  double x, y;
};
int n;
int tot;
node p[maxn];
node P[maxn];
int tot2;
node P2[maxn];
double X(node A, node B, node C) {
  return (B.x - A.x) * (C.y - A.y) - (C.x - A.x) * (B.y - A.y);
}
double dian(node A, node B, node C) {
  return (B.x - A.x) * (C.x - A.x) + (C.y - A.y) * (B.y - A.y);
}
double len(node A, node B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
bool cmp(node A, node B) {
  double pp = X(p[0], A, B);
  if (pp > 0) return true;
  if (pp < 0) return false;
  if (pp == 0) return len(p[0], A) < len(p[0], B);
}
void build() {
  for (int i = 0; i < n; i++) {
    if (p[i].y < p[0].y) swap(p[i], p[0]);
    if (p[i].y == p[0].y && p[i].x < p[0].x) swap(p[i], p[0]);
  }
  sort(p + 1, p + n, cmp);
  P[0] = p[0];
  P[1] = p[1];
  tot = 1;
  for (int i = 2; i < n; i++) {
    while (tot > 0 && X(P[tot - 1], P[tot], p[i]) <= 0) tot--;
    tot++;
    P[tot] = p[i];
  }
  tot++;
}
int x1[100011];
int asdfeawf[100011];
int x2[100011];
int y2[100011];
int a[400044];
int b[400044];
int ha[400044];
int hb[400044];
int pwb[400044];
const int hmod = 1000000007;
const int mmod = 998244353;
const int base = 233;
int dis(int x1, int asdfeawf, int x2, int y2) {
  int ans = 1LL * (x1 - x2) * (x1 - x2) % mmod +
            1LL * (asdfeawf - y2) * (asdfeawf - y2) % mmod;
  if (ans >= mmod) ans -= mmod;
  return ans;
}
void work() {
  for (int i = 0; i < (tot); i++) {
    x1[i] = P[i].x + 0.1;
    asdfeawf[i] = P[i].y + 0.1;
  }
  for (int i = 0; i < (tot2); i++) {
    x2[i] = P2[i].x + 0.1;
    y2[i] = P2[i].y + 0.1;
  }
  if (tot != tot2) {
    cout << "NO" << '\n';
    return;
  }
  for (int i = 0; i < (tot); i++) {
    int X0 = x1[(i - 1 + tot) % tot];
    int Y0 = asdfeawf[(i - 1 + tot) % tot];
    int X1 = x1[i];
    int Y1 = asdfeawf[i];
    int X2 = x1[(((i) + 1) % (tot))];
    int Y2 = asdfeawf[(((i) + 1) % (tot))];
    int len0 = dis(X0, Y0, X1, Y1);
    int len1 = dis(X1, Y1, X2, Y2);
    a[2 * i + 1] = a[2 * i + 2 * tot + 1] = len1;
    int VX0 = X0 - X1;
    long long VY0 = Y0 - Y1;
    int VX1 = X2 - X1;
    long long VY1 = Y2 - Y1;
    if (VX0 < 0) VX0 += mmod;
    if (VX1 < 0) VX1 += mmod;
    if (VY1 < 0) VY1 += mmod;
    if (VY0 < 0) VY0 += mmod;
    int DOT = (1LL * VX0 * VX1 % mmod + 1LL * VY0 * VY1 % mmod);
    if (DOT >= mmod) DOT -= mod;
    int MUL = 1LL * len0 * len1 % mmod;
    int ANG = 1LL * DOT * pw(MUL, mmod - 2, mmod) % mmod;
    a[2 * i] = a[2 * i + 2 * tot] = ANG;
  }
  for (int i = 0; i < (tot); i++) {
    int X0 = x2[(i - 1 + tot) % tot];
    int Y0 = y2[(i - 1 + tot) % tot];
    int X1 = x2[i];
    int Y1 = y2[i];
    int X2 = x2[(((i) + 1) % (tot))];
    int Y2 = y2[(((i) + 1) % (tot))];
    int len0 = dis(X0, Y0, X1, Y1);
    int len1 = dis(X1, Y1, X2, Y2);
    b[2 * i + 1] = b[2 * i + 2 * tot + 1] = len1;
    int VX0 = X0 - X1;
    long long VY0 = Y0 - Y1;
    int VX1 = X2 - X1;
    long long VY1 = Y2 - Y1;
    if (VX0 < 0) VX0 += mmod;
    if (VX1 < 0) VX1 += mmod;
    if (VY1 < 0) VY1 += mmod;
    if (VY0 < 0) VY0 += mmod;
    int DOT = (1LL * VX0 * VX1 % mmod + 1LL * VY0 * VY1 % mmod);
    if (DOT >= mmod) DOT -= mod;
    int MUL = 1LL * len0 * len1 % mmod;
    int ANG = 1LL * DOT * pw(MUL, mmod - 2, mmod) % mmod;
    b[2 * i] = b[2 * i + 2 * tot] = ANG;
  }
  for (int i = 0; i < (4 * tot); i++) {
    ha[i] = 0;
    if (i) ha[i] = 1LL * ha[i - 1] * base % hmod;
    ha[i] = (ha[i] + a[i]);
    if (ha[i] >= hmod) ha[i] -= hmod;
    hb[i] = 0;
    if (i) hb[i] = 1LL * hb[i - 1] * base % hmod;
    hb[i] = (hb[i] + b[i]);
    if (hb[i] >= hmod) hb[i] -= hmod;
  }
  int h1 = ha[2 * tot - 1];
  for (int i = 0; i < 2 * tot; i += 2) {
    int l = i;
    int r = i + 2 * tot - 1;
    int h2 = hb[r];
    if (l > 0) h2 = h2 - 1LL * hb[l - 1] * pwb[r - l + 1] % hmod;
    if (h2 < 0) h2 += hmod;
    if (h1 == h2) {
      cout << "YES" << '\n';
      return;
    }
  }
  cout << "NO" << '\n';
}
int main() {
  pwb[0] = 1;
  for (int i = 1; i < 400044; i++) pwb[i] = 1LL * pwb[i - 1] * base % hmod;
  int n1, n2;
  scanf("%d%d", &n1, &n2);
  tot = 0;
  n = n1;
  for (int i = 0; i < (n1); i++) {
    p[i].x = rint();
    p[i].y = rint();
  }
  build();
  for (int i = 0; i < (tot); i++) {
    P2[i].x = P[i].x;
    P2[i].y = P[i].y;
  }
  tot2 = tot;
  tot = 0;
  n = n2;
  for (int i = 0; i < (n2); i++) {
    p[i].x = rint();
    p[i].y = rint();
  }
  build();
  work();
}