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 n, m, p1 = 131, p2 = 1000000007, pr[500005];
pair<long long, long long> coa[500005], cob[500005];
pair<pair<long long, long long>, long long> ugha[500005], ughb[500005];
long long crs(pair<long long, long long> a, pair<long long, long long> b,
              pair<long long, long long> c) {
  return ((a.second - b.second) * (c.first - b.first) -
          (c.second - b.second) * (a.first - b.first));
}
bool eq(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first != b.first || a.second != b.second) return false;
  return true;
}
long long dis(pair<long long, long long> a, pair<long long, long long> b) {
  return ((a.first - b.first) * (a.first - b.first) +
          (a.second - b.second) * (a.second - b.second));
}
long long hsh(long long u, long long v, long long w) {
  u += 121;
  v += 2399;
  w += 29;
  return (u * p1 * p1 + v * p1 + w) % p2;
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 0; i < n; i++) {
    long long a, b;
    scanf("%lld%lld", &a, &b);
    coa[i] = {a, b};
  }
  for (long long i = 0; i < m; i++) {
    long long a, b;
    scanf("%lld%lld", &a, &b);
    cob[i] = {a, b};
  }
  sort(coa, coa + n);
  sort(cob, cob + m);
  deque<pair<long long, long long>> upa, dna, upb, dnb;
  for (long long i = 0; i < n; i++) {
    if (upa.size() < 2) {
      if (upa.size() < 1)
        upa.push_back(coa[i]);
      else if (!eq(coa[i], upa[upa.size() - 1]))
        upa.push_back(coa[i]);
    } else {
      while (crs(coa[i], upa[upa.size() - 1], upa[upa.size() - 2]) <= 0) {
        upa.pop_back();
        if (upa.size() < 2) break;
      }
      if (upa.size() < 2) {
        if (upa.size() < 1)
          upa.push_back(coa[i]);
        else if (!eq(coa[i], upa[upa.size() - 1]))
          upa.push_back(coa[i]);
      } else
        upa.push_back(coa[i]);
    }
  }
  for (long long i = 0; i < n; i++) {
    if (dna.size() < 2) {
      if (dna.size() < 1)
        dna.push_back(coa[i]);
      else if (!eq(coa[i], dna[dna.size() - 1]))
        dna.push_back(coa[i]);
    } else {
      while (crs(coa[i], dna[dna.size() - 1], dna[dna.size() - 2]) >= 0) {
        dna.pop_back();
        if (dna.size() < 2) break;
      }
      if (dna.size() < 2) {
        if (dna.size() < 1)
          dna.push_back(coa[i]);
        else if (!eq(coa[i], dna[dna.size() - 1]))
          dna.push_back(coa[i]);
      } else
        dna.push_back(coa[i]);
    }
  }
  if (upa.size() > 0 && dna.size() > 0)
    if (eq(upa.front(), dna.front())) upa.pop_front();
  if (upa.size() > 0 && dna.size() > 0)
    if (eq(upa.back(), dna.back())) upa.pop_back();
  if (upa.size() > 0 && dna.size() > 0)
    if (upa.front().first == dna.front().first &&
        upa.front().second < dna.front().second)
      upa.pop_front();
  if (upa.size() > 0 && dna.size() > 0)
    if (upa.back().first == dna.back().first &&
        upa.back().second < dna.back().second)
      upa.pop_back();
  while (dna.size() > 0) {
    upa.push_back(dna.back());
    dna.pop_back();
  }
  for (long long i = 0; i < m; i++) {
    if (upb.size() < 2) {
      if (upb.size() < 1)
        upb.push_back(cob[i]);
      else if (!eq(cob[i], upb[upb.size() - 1]))
        upb.push_back(cob[i]);
    } else {
      while (crs(cob[i], upb[upb.size() - 1], upb[upb.size() - 2]) <= 0) {
        upb.pop_back();
        if (upb.size() < 2) break;
      }
      if (upb.size() < 2) {
        if (upb.size() < 1)
          upb.push_back(cob[i]);
        else if (!eq(cob[i], upb[upb.size() - 1]))
          upb.push_back(cob[i]);
      } else
        upb.push_back(cob[i]);
    }
  }
  for (long long i = 0; i < m; i++) {
    if (dnb.size() < 2) {
      if (dnb.size() < 1)
        dnb.push_back(cob[i]);
      else if (!eq(cob[i], dnb[dnb.size() - 1]))
        dnb.push_back(cob[i]);
    } else {
      while (crs(cob[i], dnb[dnb.size() - 1], dnb[dnb.size() - 2]) >= 0) {
        dnb.pop_back();
        if (dnb.size() < 2) break;
      }
      if (dnb.size() < 2) {
        if (dnb.size() < 1)
          dnb.push_back(cob[i]);
        else if (!eq(cob[i], dnb[dnb.size() - 1]))
          dnb.push_back(cob[i]);
      } else
        dnb.push_back(cob[i]);
    }
  }
  if (upb.size() > 0 && dnb.size() > 0)
    if (eq(upb.front(), dnb.front())) upb.pop_front();
  if (upb.size() > 0 && dnb.size() > 0)
    if (eq(upb.back(), dnb.back())) upb.pop_back();
  if (upb.size() > 0 && dnb.size() > 0)
    if (upb.front().first == dnb.front().first &&
        upb.front().second < dnb.front().second)
      upb.pop_front();
  if (upb.size() > 0 && dnb.size() > 0)
    if (upb.back().first == dnb.back().first &&
        upb.back().second < dnb.back().second)
      upb.pop_back();
  while (dnb.size() > 0) {
    upb.push_back(dnb.back());
    dnb.pop_back();
  }
  if (upa.size() != upb.size()) {
    printf("NO\n");
    return 0;
  }
  if (upa.size() <= 1) {
    printf("YES\n");
    return 0;
  }
  long long sz = upa.size();
  ugha[0] = {{dis(upa[0], upa[sz - 1]), dis(upa[1], upa[0])},
             dis(upa[sz - 1], upa[1])};
  for (long long i = 1; i < sz - 1; i++) {
    ugha[i] = {{dis(upa[i], upa[i - 1]), dis(upa[i], upa[i + 1])},
               dis(upa[i - 1], upa[i + 1])};
  }
  ugha[sz - 1] = {{dis(upa[sz - 1], upa[sz - 2]), dis(upa[sz - 1], upa[0])},
                  dis(upa[sz - 2], upa[0])};
  ugha[0 + sz] = {{dis(upa[0], upa[sz - 1]), dis(upa[1], upa[0])},
                  dis(upa[sz - 1], upa[1])};
  for (long long i = 1; i < sz - 1; i++) {
    ugha[i + sz] = {{dis(upa[i], upa[i - 1]), dis(upa[i], upa[i + 1])},
                    dis(upa[i - 1], upa[i + 1])};
  }
  ugha[sz - 1 + sz] = {
      {dis(upa[sz - 1], upa[sz - 2]), dis(upa[sz - 1], upa[0])},
      dis(upa[sz - 2], upa[0])};
  ughb[0] = {{dis(upb[0], upb[sz - 1]), dis(upb[1], upb[0])},
             dis(upb[sz - 1], upb[1])};
  for (long long i = 1; i < sz - 1; i++) {
    ughb[i] = {{dis(upb[i], upb[i - 1]), dis(upb[i], upb[i + 1])},
               dis(upb[i - 1], upb[i + 1])};
  }
  ughb[sz - 1] = {{dis(upb[sz - 1], upb[sz - 2]), dis(upb[sz - 1], upb[0])},
                  dis(upb[sz - 2], upb[0])};
  long long hmm = 0;
  for (long long i = 1; i <= sz; i++) {
    hmm = (hsh(ughb[i - 1].first.first, ughb[i - 1].first.second,
               ughb[i - 1].second) +
           p1 * hmm) %
          p2;
  }
  long long pp = 1;
  for (long long i = 0; i < sz; i++) pp = (pp * p1) % p2;
  for (long long i = 1; i <= 2 * sz; i++) {
    pr[i] = (hsh(ugha[i - 1].first.first, ugha[i - 1].first.second,
                 ugha[i - 1].second) +
             p1 * pr[i - 1]) %
            p2;
  }
  for (long long i = sz + 1; i <= 2 * sz; i++) {
    long long hk = ((pr[i] - pr[i - sz] * pp) % p2 + p2) % p2;
    if (hk == hmm) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}