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;
vector<pair<int, int> > points;
pair<int, int> pivot;
vector<pair<int, int> > ch1, ch2;
inline bool deq(const double &a, const double &b) {
  return fabs(a - b) < 1e-10;
}
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
bool cmp1(const pair<int, int> &a, const pair<int, int> &b) {
  double ma;
  if (a.first == pivot.first)
    ma = 1e10;
  else
    ma = (a.second - pivot.second) / ((double)(a.first - pivot.first));
  double mb;
  if (b.first == pivot.first)
    mb = 1e10;
  else
    mb = (b.second - pivot.second) / ((double)(b.first - pivot.first));
  double dista = (sqrt(((long long)a.first - pivot.first) *
                           ((long long)a.first - pivot.first) +
                       ((long long)a.second - pivot.second) *
                           ((long long)a.second - pivot.second)));
  double distb = (sqrt(((long long)b.first - pivot.first) *
                           ((long long)b.first - pivot.first) +
                       ((long long)b.second - pivot.second) *
                           ((long long)b.second - pivot.second)));
  if (deq(ma, mb)) return dista > distb;
  return ma < mb;
}
bool cmp2(const pair<int, int> &a, const pair<int, int> &b) {
  double ma;
  if (a.first == pivot.first)
    ma = 1e10;
  else
    ma = (a.second - pivot.second) / ((double)(a.first - pivot.first));
  double mb;
  if (b.first == pivot.first)
    mb = 1e10;
  else
    mb = (b.second - pivot.second) / ((double)(b.first - pivot.first));
  double dista = (sqrt(((long long)a.first - pivot.first) *
                           ((long long)a.first - pivot.first) +
                       ((long long)a.second - pivot.second) *
                           ((long long)a.second - pivot.second)));
  double distb = (sqrt(((long long)b.first - pivot.first) *
                           ((long long)b.first - pivot.first) +
                       ((long long)b.second - pivot.second) *
                           ((long long)b.second - pivot.second)));
  if (deq(ma, mb)) return dista < distb;
  return ma < mb;
}
double cross(pair<int, int> a, pair<int, int> b) {
  return (double)a.first * (double)b.second -
         (double)a.second * (double)b.first;
}
bool ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  pair<int, int> ab = make_pair(b.first - a.first, b.second - a.second);
  pair<int, int> ac = make_pair(c.first - a.first, c.second - a.second);
  double x = cross(ab, ac);
  return x > 0 && !deq(x, 0);
}
double get_slope(pair<int, int> a, pair<int, int> b) {
  double ret;
  if (a.first != b.first)
    ret = (a.second - b.second) / ((double)(a.first - b.first));
  else
    ret = 1e10;
  return ret;
}
void fcvxh(vector<pair<int, int> > &ret) {
  sort(points.begin(), points.end(), cmp);
  pivot = points[0];
  sort(points.begin() + 1, points.end(), cmp1);
  double fixangle = get_slope(points[1], pivot);
  int fix = 2;
  while (fix < points.size() && deq(fixangle, get_slope(points[fix], pivot)))
    fix++;
  sort(points.begin() + 1, points.begin() + fix, cmp2);
  stack<pair<int, int> > C;
  C.push(pivot);
  C.push(points[fix - 1]);
  for (int i = fix; i < points.size(); i++) {
    pair<int, int> b = C.top();
    C.pop();
    pair<int, int> a = C.top();
    C.pop();
    pair<int, int> c = points[i];
    if (ccw(a, b, c)) {
      C.push(a);
      C.push(b);
      C.push(c);
    } else {
      C.push(a);
      i--;
    }
  }
  while (true) {
    pair<int, int> b = C.top();
    C.pop();
    pair<int, int> a = C.top();
    C.pop();
    pair<int, int> c = pivot;
    if (ccw(a, b, c)) {
      C.push(a);
      C.push(b);
      break;
    } else if (deq(fixangle, get_slope(b, pivot))) {
      C.push(a);
      C.push(b);
      break;
    } else {
      C.push(a);
    }
  }
  while (!C.empty()) {
    ret.push_back(C.top());
    C.pop();
  }
  reverse(ret.begin(), ret.end());
}
int fix(int x, int m) { return ((x % m) + m) % m; }
double dot(pair<int, int> a, pair<int, int> b) {
  return (double)a.first * (double)b.first +
         (double)a.second * (double)b.second;
}
bool dodeq(pair<double, double> a, pair<double, double> b) {
  return deq(a.first, b.first) && deq(a.second, b.second);
}
int rew[100010];
bool cyclic_equals(vector<pair<double, double> > S1,
                   vector<pair<double, double> > S2) {
  assert(S1.size() <= 100000);
  assert(S2.size() <= 100000);
  if (S1.size() != S2.size()) return false;
  vector<pair<double, double> > S;
  for (int i = 0; i < S2.size(); i++) S.push_back(S2[i]);
  for (int i = 0; i < S2.size(); i++) S.push_back(S2[i]);
  rew[0] = 0;
  rew[1] = 0;
  for (int i = 2; i <= S1.size(); i++) {
    int j = rew[i - 1];
    while (j > 0 && !dodeq(S1[j], S1[i - 1])) j = rew[j];
    if (j > 0)
      rew[i] = j + 1;
    else if (i > 1 && dodeq(S1[0], S1[i - 1]))
      rew[i] = 1;
    else
      rew[i] = 0;
  }
  bool flag = false;
  int state = 0;
  for (int i = 0; i < S.size(); i++) {
    pair<double, double> c = S[i];
    if (dodeq(c, S1[state]))
      state++;
    else {
      while (state != 0 && !dodeq(c, S1[state])) state = rew[state];
      if (state != 0 || dodeq(c, S1[state])) state++;
    }
    if (state == S1.size()) {
      flag = true;
      break;
    }
    assert(state < S1.size());
  }
  return flag;
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N1, N2;
  cin >> N1 >> N2;
  for (int i = 0; i < N1; i++) {
    int a, b;
    cin >> a >> b;
    points.push_back(make_pair(a, b));
  }
  fcvxh(ch1);
  points.clear();
  for (int i = 0; i < N2; i++) {
    int a, b;
    cin >> a >> b;
    points.push_back(make_pair(a, b));
  }
  fcvxh(ch2);
  vector<pair<double, double> > T1;
  for (int i = 0; i < ch1.size(); i++) {
    pair<int, int> cur = ch1[i];
    pair<int, int> nxt = ch1[fix(i + 1, ch1.size())];
    pair<int, int> pre = ch1[fix(i - 1, ch1.size())];
    double len = (sqrt(((long long)cur.first - nxt.first) *
                           ((long long)cur.first - nxt.first) +
                       ((long long)cur.second - nxt.second) *
                           ((long long)cur.second - nxt.second)));
    pair<int, int> cn =
        make_pair(nxt.first - cur.first, nxt.second - cur.second);
    pair<int, int> pc =
        make_pair(cur.first - pre.first, cur.second - pre.second);
    double ang = atan2(cross(pc, cn), dot(pc, cn));
    T1.push_back(make_pair(len, ang));
  }
  vector<pair<double, double> > T2;
  for (int i = 0; i < ch2.size(); i++) {
    pair<int, int> cur = ch2[i];
    pair<int, int> nxt = ch2[fix(i + 1, ch2.size())];
    pair<int, int> pre = ch2[fix(i - 1, ch2.size())];
    double len = (sqrt(((long long)cur.first - nxt.first) *
                           ((long long)cur.first - nxt.first) +
                       ((long long)cur.second - nxt.second) *
                           ((long long)cur.second - nxt.second)));
    pair<int, int> cn =
        make_pair(nxt.first - cur.first, nxt.second - cur.second);
    pair<int, int> pc =
        make_pair(cur.first - pre.first, cur.second - pre.second);
    double ang = atan2(cross(pc, cn), dot(pc, cn));
    T2.push_back(make_pair(len, ang));
  }
  if (cyclic_equals(T1, T2)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}