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;
const int mod = (1e9) + 7;
const double eps = 1e-6;
const int siz = 1e5 + 5, siz2 = 1e5 + 5;
long long mul(long long a, long long b) { return a * b; }
struct point {
  int x, y, i;
  point min(point &p) {
    if (x != p.x) {
      if (x < p.x) {
        return *this;
      }
      return p;
    }
    if (y < p.y) {
      return *this;
    }
    return p;
  }
  point max(point &p) {
    if (x != p.x) {
      if (x > p.x) {
        return *this;
      }
      return p;
    }
    if (y > p.y) {
      return *this;
    }
    return p;
  }
  bool eq(point &p) { return x == p.x && y == p.y; }
};
bool cmp(point &a, point &b) {
  if (a.x != b.x) {
    return a.x < b.x;
  }
  return a.y < b.y;
}
int cross(point &a, point &b, point &c) {
  point ab = {b.x - a.x, b.y - a.y}, ac = {c.x - a.x, c.y - a.y};
  long long res = mul(ab.x, ac.y) - mul(ac.x, ab.y);
  return res > 0 ? 1 : (res < 0 ? -1 : 0);
}
long long dot(point &a, point &b, point &c) {
  point ba = {a.x - b.x, a.y - b.y}, bc = {c.x - b.x, c.y - b.y};
  return mul(ba.x, bc.x) + mul(ba.y, bc.y);
}
int nxt(int i, int sz) { return (i + 1) % sz; }
int prv(int i, int sz) { return (i - 1 + sz) % sz; }
void adjust(vector<point> &ps) {
  int sz = ps.size();
  for (int i = 0; i < sz; i++) {
    ps[i].i = i;
  }
}
vector<point> merge(vector<point> &lft_ch, vector<point> &rit_ch) {
  point mx_l = {INT_MIN, INT_MIN, -1}, mn_r = {INT_MAX, INT_MAX, -1};
  for (auto &p : lft_ch) {
    mx_l = mx_l.max(p);
  }
  for (auto &p : rit_ch) {
    mn_r = mn_r.min(p);
  }
  point up_l = mx_l, up_r = mn_r, down_l = mx_l, down_r = mn_r;
  int sz_l = lft_ch.size(), sz_r = rit_ch.size();
  point temp_r = {INT_MAX}, temp_l = {INT_MAX};
  while (true) {
    bool done = true;
    if (sz_r != 1) {
      int c = cross(up_l, up_r, rit_ch[prv(up_r.i, sz_r)]);
      if (c >= 0) {
        if (c == 1 || !temp_r.eq(rit_ch[prv(up_r.i, sz_r)])) {
          if (c == 0 && temp_r.x == INT_MAX) {
            temp_r = up_r;
          }
          done = false;
          up_r = rit_ch[prv(up_r.i, sz_r)];
        }
      }
    }
    if (sz_l != 1) {
      int c = cross(up_r, up_l, lft_ch[nxt(up_l.i, sz_l)]);
      if (c <= 0) {
        if (c == -1 || !temp_l.eq(lft_ch[nxt(up_l.i, sz_l)])) {
          if (c == 0 && temp_l.x == INT_MAX) {
            temp_l = up_l;
          }
          done = false;
          up_l = lft_ch[nxt(up_l.i, sz_l)];
        }
      }
    }
    if (done) {
      break;
    }
  }
  temp_r = {INT_MAX};
  temp_l = {INT_MAX};
  while (true) {
    bool done = true;
    if (sz_r != 1) {
      int c = cross(down_l, down_r, rit_ch[nxt(down_r.i, sz_r)]);
      if (c <= 0) {
        if (c == -1 || !temp_r.eq(rit_ch[nxt(down_r.i, sz_r)])) {
          if (c == 0 && temp_r.x == INT_MAX) {
            temp_r = down_r;
          }
          done = false;
          down_r = rit_ch[nxt(down_r.i, sz_r)];
        }
      }
    }
    if (sz_l != 1) {
      int c = cross(down_r, down_l, lft_ch[prv(down_l.i, sz_l)]);
      if (c >= 0) {
        if (c == 1 || !temp_l.eq(lft_ch[prv(down_l.i, sz_l)])) {
          if (c == 0 && temp_l.x == INT_MAX) {
            temp_l = down_l;
          }
          done = false;
          down_l = lft_ch[prv(down_l.i, sz_l)];
        }
      }
    }
    if (done) {
      break;
    }
  }
  vector<point> ret_ch;
  while (true) {
    ret_ch.push_back(up_l);
    if (up_l.eq(down_l)) {
      break;
    }
    up_l = lft_ch[nxt(up_l.i, sz_l)];
  }
  while (true) {
    ret_ch.push_back(down_r);
    if (down_r.eq(up_r)) {
      break;
    }
    down_r = rit_ch[nxt(down_r.i, sz_r)];
  }
  adjust(ret_ch);
  return ret_ch;
}
vector<point> ch(vector<point> &ps) {
  if (ps.size() == 1) {
    adjust(ps);
    return ps;
  }
  vector<point> lft, rit;
  int sz = ps.size();
  for (int i = 0; i < sz; i++) {
    if (i < sz / 2) {
      lft.push_back(ps[i]);
    } else {
      rit.push_back(ps[i]);
    }
  }
  vector<point> lft_ch = ch(lft), rit_ch = ch(rit);
  return merge(lft_ch, rit_ch);
}
int kmp_res[siz * 6];
bool kmp(vector<long long> &pat, vector<long long> &data) {
  vector<long long> full;
  for (auto v : pat) {
    full.push_back(v);
  }
  full.push_back(LLONG_MAX);
  for (auto v : data) {
    full.push_back(v);
  }
  int sz = full.size(), to_reach = pat.size();
  kmp_res[0] = 0;
  for (int i = 1; i < sz; i++) {
    int j = i - 1;
    while (j >= 0 && full[kmp_res[j]] != full[i]) {
      j = kmp_res[j] - 1;
    }
    kmp_res[i] = j >= 0 ? kmp_res[j] + 1 : 0;
    if (kmp_res[i] == to_reach) {
      return true;
    }
  }
  return false;
}
int n, m;
vector<point> n_p, m_p;
long long sqr_dis(point &a, point &b) {
  return mul(a.x - b.x, a.x - b.x) + mul(a.y - b.y, a.y - b.y);
}
vector<long long> hull_to_chain(vector<point> &h) {
  vector<long long> ret;
  int sz = h.size();
  for (int i = 0; i < sz; i++) {
    int nxt_1 = nxt(i, sz), nxt_2 = nxt(nxt(i, sz), sz);
    ret.push_back(sqr_dis(h[i], h[nxt_1]));
    ret.push_back(dot(h[i], h[nxt_1], h[nxt_2]));
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    n_p.push_back({x, y, i});
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    m_p.push_back({x, y, i});
  }
  sort(n_p.begin(), n_p.end(), cmp);
  sort(m_p.begin(), m_p.end(), cmp);
  vector<point> n_h = ch(n_p), m_h = ch(m_p);
  int n_sz = n_h.size(), m_sz = m_h.size();
  if (min(n_sz, m_sz) == 2) {
    printf("%s\n",
           (n_sz == m_sz && sqr_dis(n_h[0], n_h[1]) == sqr_dis(m_h[0], m_h[1])
                ? "YES"
                : "NO"));
  } else {
    vector<long long> m_chain = hull_to_chain(m_h),
                      n_chain = hull_to_chain(n_h);
    int n_chain_sz = n_chain.size();
    for (int i = 0; i < n_chain_sz - 1; i++) {
      n_chain.push_back(n_chain[i]);
    }
    printf("%s\n", (kmp(m_chain, n_chain) ? "YES" : "NO"));
  }
  return 0;
}