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;
int N, M;
vector<pair<signed long long, signed long long>> A, B;
vector<pair<long double, long double>> C, D;
const signed long long EPS = 0;
template <class C>
C veccross(pair<C, C> p1, pair<C, C> p2, pair<C, C> p3) {
  p3.first -= p1.first;
  p2.first -= p1.first;
  p3.second -= p1.second;
  p2.second -= p1.second;
  return p3.first * p2.second - p2.first * p3.second;
}
template <class C>
vector<int> convex_hull(vector<pair<C, C>>& vp) {
  vector<pair<pair<C, C>, int>> sorted;
  vector<int> res;
  int i, k = 0, rb;
  if (vp.size() <= 2) {
    if (vp.size() >= 1) res.push_back(0);
    if (vp.size() >= 2 && vp[0] != vp[1]) res.push_back(1);
    return res;
  }
  for (i = 0; i < (vp.size()); i++) sorted.push_back(make_pair(vp[i], i));
  sort(sorted.begin(), sorted.end());
  res.resize(vp.size() * 2);
  for (i = 0; i < (vp.size()); i++) {
    while (k > 1 &&
           veccross(vp[res[k - 2]], vp[res[k - 1]], sorted[i].first) <= -EPS)
      k--;
    res[k++] = sorted[i].second;
  }
  for (rb = k, i = vp.size() - 2; i >= 0; i--) {
    while (k > rb &&
           veccross(vp[res[k - 2]], vp[res[k - 1]], sorted[i].first) <= -EPS)
      k--;
    res[k++] = sorted[i].second;
  }
  res.resize(k - 1);
  return res;
}
pair<long double, long double> center(
    vector<pair<long double, long double>> V) {
  if (V.size() == 1) return V[0];
  if (V.size() == 2)
    return {(V[0].first + V[1].first) / 2, (V[0].second + V[1].second) / 2};
  long double dx = 0, dy = 0, A = 0;
  int i;
  for (i = 1; i < V.size() - 1; i++) {
    long double cx = (V[0].first + V[i].first + V[i + 1].first) / 3;
    long double cy = (V[0].second + V[i].second + V[i + 1].second) / 3;
    long double cr =
        abs((V[i].first - V[0].first) * (V[i + 1].second - V[0].second) -
            (V[i + 1].first - V[0].first) * (V[i].second - V[0].second));
    A += cr;
    dx += cx * cr;
    dy += cy * cr;
  }
  assert(A);
  return {dx / A, dy / A};
}
vector<pair<long double, long double>> hoge(
    vector<pair<signed long long, signed long long>> A) {
  vector<pair<long double, long double>> C;
  auto v = convex_hull(A);
  long double dx = 0, dy = 0;
  for (auto& c : v) {
    C.push_back({A[c].first, A[c].second});
  }
  auto ce = center(C);
  for (auto& c : C) c.first -= ce.first, c.second -= ce.second;
  return C;
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> M;
  for (i = 0; i < (N); i++) {
    cin >> x >> y;
    A.push_back({x, y});
  }
  for (i = 0; i < (M); i++) {
    cin >> x >> y;
    B.push_back({x, y});
  }
  C = hoge(A);
  D = hoge(B);
  N = C.size();
  M = D.size();
  if (N != M) return (void)printf("NO\n");
  for (i = 0; i < (N); i++)
    if (abs(hypot(C[i].first, C[i].second) - hypot(D[0].first, D[0].second)) <
        1e-2) {
      long double deg =
          atan2(D[0].second, D[0].first) - atan2(C[i].second, C[i].first);
      for (j = 0; j < (N); j++) {
        long double dx = C[j].first * cos(deg) - C[j].second * sin(deg);
        long double dy = C[j].first * sin(deg) + C[j].second * cos(deg);
        if (abs(dx - D[(j + N - i) % N].first) +
                abs(dy - D[(j + N - i) % N].second) >
            1e-2)
          break;
      }
      if (j == N) return (void)printf("YES\n");
    }
  (void)printf("NO\n");
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}