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 GCC optimize("Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int MOD = 1000000007;
const int UNDEF = -1;
const int INF = 1 << 30;
template <typename T>
inline bool chkmax(T &aa, T bb) {
  return aa < bb ? aa = bb, true : false;
}
template <typename T>
inline bool chkmin(T &aa, T bb) {
  return aa > bb ? aa = bb, true : false;
}
int rint();
char rch();
long long rlong();
long long len2(pair<int, int> a, pair<int, int> b) {
  long long dx = a.first - b.first;
  long long dy = a.second - b.second;
  return dx * dx + dy * dy;
}
long long ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  b.first -= a.first;
  b.second -= a.second;
  c.first -= a.first;
  c.second -= a.second;
  return b.first * (long long)c.second - c.first * (long long)b.second;
}
long long dot(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  return (a.first - b.first) * (long long)(c.first - b.first) +
         (a.second - b.second) * (long long)(c.second - b.second);
}
vector<pair<int, int> > convexHull(vector<pair<int, int> > dat) {
  vector<pair<int, int> > upper, lower;
  sort(dat.begin(), dat.end());
  for (int i = 0; i < dat.size(); i++) {
    while (upper.size() >= 2 &&
           ccw(*++upper.rbegin(), *upper.rbegin(), dat[i]) >= 0)
      upper.pop_back();
    while (lower.size() >= 2 &&
           ccw(*++lower.rbegin(), *lower.rbegin(), dat[i]) <= 0)
      lower.pop_back();
    upper.emplace_back(dat[i]);
    lower.emplace_back(dat[i]);
  }
  upper.insert(upper.end(), ++lower.rbegin(), --lower.rend());
  return upper;
}
vector<pair<long long, long long> > serialize(vector<pair<int, int> > v) {
  int n = v.size();
  vector<pair<long long, long long> > vans;
  for (int i = 0; i < n; i++) {
    int k = (i + 1);
    if (k >= n) k -= n;
    int p = (i - 1);
    if (p < 0) p += n;
    long long cw = dot(v[p], v[i], v[k]);
    long long len = len2(v[i], v[k]);
    vans.push_back(make_pair(cw, len));
  }
  return vans;
}
vector<pair<long long, long long> > b;
int bins(pair<long long, long long> key) {
  int imin = 0, imax = b.size();
  while (imin < imax) {
    int imid = (imin + imax) >> 1;
    if (b[imid] < key)
      imin = imid + 1;
    else
      imax = imid;
  }
  return imin;
}
class KMP {
 public:
  vector<int> fail;
  vector<int> p;
  int gm;
  int dfa(int j, int x) {
    ++j;
    while (j > 0 && x != p[j - 1]) {
      j = fail[j];
    }
    return j;
  }
  void buildfail() {
    int m = gm;
    int j = 0;
    for (int i = 1; i <= m; i++) {
      fail[i] = j;
      while (j > 0 && p[i - 1] != p[j - 1]) {
        j = fail[j];
      }
      j++;
    }
    fail[m + 1] = j;
  }
  void init(vector<int> pattern) {
    int m = pattern.size();
    gm = m;
    fail.resize(m + 2);
    p = pattern;
    buildfail();
  }
};
KMP kmp;
int n[2];
vector<pair<long long, long long> > g[2];
vector<int> q[2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int t = 0; t < 2; t++) n[t] = rint();
  for (int t = 0; t < 2; t++) {
    vector<pair<int, int> > v;
    v.reserve(n[t]);
    for (int i = 0; i < n[t]; i++) {
      v.push_back(make_pair(rint(), rint()));
    }
    g[t] = serialize(convexHull(v));
  }
  b = g[0];
  for (auto &w : g[1]) b.push_back(w);
  sort(b.begin(), b.end());
  auto it = unique(b.begin(), b.end());
  b.resize(it - b.begin());
  for (int t = 0; t < 2; t++) {
    q[t].reserve(g[t].size());
    for (auto &w : g[t]) {
      q[t].push_back(bins(w));
    }
  }
  kmp.init(q[0]);
  int x = 0;
  for (int k = 0; k < 2; k++) {
    for (auto &w : q[1]) {
      x = kmp.dfa(x, w);
      if (x == q[0].size()) {
        printf("YES\n");
        exit(0);
      }
    }
  }
  printf("NO\n");
}
static char stdinBuffer[1024];
static char *stdinDataEnd = stdinBuffer + sizeof(stdinBuffer);
static const char *stdinPos = stdinDataEnd;
void readAhead(size_t amount) {
  size_t remaining = stdinDataEnd - stdinPos;
  if (remaining < amount) {
    memmove(stdinBuffer, stdinPos, remaining);
    size_t sz = fread(stdinBuffer + remaining, 1,
                      sizeof(stdinBuffer) - remaining, stdin);
    stdinPos = stdinBuffer;
    stdinDataEnd = stdinBuffer + remaining + sz;
    if (stdinDataEnd != stdinBuffer + sizeof(stdinBuffer)) *stdinDataEnd = 0;
  }
}
int rint() {
  readAhead(16);
  int x = 0;
  bool neg = false;
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  if (*stdinPos == '-') {
    ++stdinPos;
    neg = true;
  }
  while (*stdinPos >= '0' && *stdinPos <= '9') {
    x *= 10;
    x += *stdinPos - '0';
    ++stdinPos;
  }
  return neg ? -x : x;
}
char rch() {
  readAhead(16);
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  char ans = *stdinPos;
  ++stdinPos;
  return ans;
}
long long rlong() {
  readAhead(32);
  long long x = 0;
  bool neg = false;
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  if (*stdinPos == '-') {
    ++stdinPos;
    neg = true;
  }
  while (*stdinPos >= '0' && *stdinPos <= '9') {
    x *= 10;
    x += *stdinPos - '0';
    ++stdinPos;
  }
  return neg ? -x : x;
}