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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
namespace Mymath {
long long qp(long long x, long long p, long long mod) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = ans * x % mod;
    x = x * x % mod;
    p >>= 1;
  }
  return ans;
}
long long inv(long long x, long long mod) { return qp(x, mod - 2, mod); }
long long C(long long N, long long K, long long fact[], long long mod) {
  return fact[N] * inv(fact[K], mod) % mod * inv(fact[N - K], mod) % mod;
}
template <typename Tp>
Tp gcd(Tp A, Tp B) {
  if (B == 0) return A;
  return gcd(B, A % B);
}
template <typename Tp>
Tp lcm(Tp A, Tp B) {
  return A * B / gcd(A, B);
}
};  // namespace Mymath
namespace fwt {
using namespace Mymath;
void FWT(int a[], int n, long long mod) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = (x + y) % mod, a[i + j + d] = (x - y + mod) % mod;
      }
}
void UFWT(int a[], int n, long long mod) {
  long long rev = inv(2, mod);
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = 1LL * (x + y) * rev % mod,
              a[i + j + d] = (1LL * (x - y) * rev % mod + mod) % mod;
      }
}
void solve(int a[], int b[], int n, long long mod) {
  FWT(a, n, mod);
  FWT(b, n, mod);
  for (int i = 0; i < n; i++) a[i] = 1LL * a[i] * b[i] % mod;
  UFWT(a, n, mod);
}
};  // namespace fwt
const int Maxn = 100005;
struct P {
  long long x, y;
  P(long long X, long long Y) { x = X, y = Y; }
  P() { x = y = 0; }
  P operator+(P p) { return P(x + p.x, y + p.y); }
  P operator-(P p) { return P(x - p.x, y - p.y); }
  P operator*(double k) { return P(x * k, y * k); }
  long long det(P p) { return x * p.y - y * p.x; }
  long long dot(P p) { return x * p.x + y * p.y; }
  bool operator<(const P& p) const {
    if (x != p.x) return x < p.x;
    return y < p.y;
  }
  double dist() { return sqrt((double)x * x + y * y); }
};
P A[Maxn], B[Maxn];
int n, m;
vector<P> xp, yp;
vector<P> build(P X[], int l) {
  vector<P> ret;
  sort(X + 1, X + 1 + l);
  ret.push_back(X[1]);
  for (int i = 2; i <= l; i++) {
    while (ret.size() >= 2 &&
           (ret[ret.size() - 2] - X[i]).det(ret[ret.size() - 1] - X[i]) >= 0) {
      ret.pop_back();
    }
    ret.push_back(X[i]);
  }
  int rs = ret.size() + 1;
  for (int i = l - 1; i >= 1; i--) {
    while (ret.size() >= rs &&
           (ret[ret.size() - 2] - X[i]).det(ret[ret.size() - 1] - X[i]) >= 0) {
      ret.pop_back();
    }
    ret.push_back(X[i]);
  }
  return ret;
}
using namespace Mymath;
const long long mod1 = 998244353;
const long long mod2 = 1000000007;
long long aa[Maxn], ab[Maxn];
long long pa1[Maxn], pa2[Maxn];
long long pb1[Maxn], pb2[Maxn];
long long Fa1[Maxn], Fa2[Maxn];
long long ifa1[Maxn], ifa2[Maxn];
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) {
    A[i].x = read();
    A[i].y = read();
  }
  for (int i = 1; i <= m; i++) {
    B[i].x = read();
    B[i].y = read();
  }
  xp = build(A, n);
  yp = build(B, m);
  if (xp.size() != yp.size()) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i < xp.size() - 1; i++) {
    P ta = xp[i - 1] - xp[i], tb = xp[i + 1] - xp[i];
    long long X = ta.det(tb);
    aa[i] = X;
  }
  {
    P ta = xp[1] - xp[0], tb = xp[xp.size() - 2] - xp[0];
    long long X = ta.det(tb);
    X = -(X);
    aa[0] = aa[xp.size() - 1] = X;
  }
  for (int i = 1; i < yp.size() - 1; i++) {
    P ta = yp[i - 1] - yp[i], tb = yp[i + 1] - yp[i];
    long long X = ta.det(tb);
    ab[i] = X;
  }
  {
    P ta = yp[1] - yp[0], tb = yp[yp.size() - 2] - yp[0];
    long long X = ta.det(tb);
    X = -X;
    ab[0] = ab[yp.size() - 1] = X;
  }
  vector<pair<long long, long long> > P1, P2;
  P1.push_back(make_pair(0, 0));
  for (int i = 0; i < xp.size() - 1; i++) {
    P ed = xp[i + 1] - xp[i];
    long long dd = ed.x * ed.x + ed.y * ed.y;
    long long h1 = dd % mod1 * 239429834 + aa[i] % mod1 * 834728734 +
                   aa[i + 1] % mod1 * 349828333;
    h1 %= mod1;
    long long h2 = dd % mod2 * 239429834 + aa[i] % mod2 * 834728734 +
                   aa[i + 1] % mod2 * 349828333;
    h2 %= mod2;
    P1.push_back(make_pair(h1, h2));
  }
  P2.push_back(make_pair(0, 0));
  for (int i = 0; i < yp.size() - 1; i++) {
    P ed = yp[i + 1] - yp[i];
    long long dd = ed.x * ed.x + ed.y * ed.y;
    long long h1 = dd % mod1 * 239429834 + ab[i] % mod1 * 834728734 +
                   ab[i + 1] % mod1 * 349828333;
    h1 %= mod1;
    long long h2 = dd % mod2 * 239429834 + ab[i] % mod2 * 834728734 +
                   ab[i + 1] % mod2 * 349828333;
    h2 %= mod2;
    P2.push_back(make_pair(h1, h2));
  }
  int L = P1.size() - 1;
  for (int i = 1; i <= L; i++) {
    pa1[i] = pa1[i - 1] * 93482874 + P1[i].first;
    pa1[i] %= mod1;
    pa2[i] = pa2[i - 1] * 93482874 + P1[i].second;
    pa2[i] %= mod2;
  }
  for (int i = 1; i <= L; i++) {
    pb1[i] = pb1[i - 1] * 93482874 + P2[i].first;
    pb1[i] %= mod1;
    pb2[i] = pb2[i - 1] * 93482874 + P2[i].second;
    pb2[i] %= mod2;
  }
  Fa1[0] = Fa2[0] = 1;
  for (int i = 1; i < Maxn; i++) {
    Fa1[i] = Fa1[i - 1] * 93482874 % mod1;
    Fa2[i] = Fa2[i - 1] * 93482874 % mod2;
  }
  for (int i = 1; i <= L; i++) {
    long long h1 = pa1[L] - pa1[i - 1] * Fa1[L - i + 1];
    h1 = (h1 % mod1 + mod1) % mod1;
    h1 = h1 * Fa1[i - 1] + pa1[i - 1];
    h1 %= mod1;
    long long h2 = pa2[L] - pa2[i - 1] * Fa2[L - i + 1];
    h2 = (h2 % mod2 + mod2) % mod2;
    h2 = h2 * Fa2[i - 1] + pa2[i - 1];
    h2 %= mod2;
    if (h1 == pb1[L] && h2 == pb2[L]) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}