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 myRnd() { return abs(((rand() << 14) ^ rand())); }
int myRnd(int L, int R) {
  return abs(((rand() << 15) ^ rand())) % (R - L + 1) + L;
}
void Parr(int *arr, int L, int R) {
  for (int i = L; R >= i; i++) {
    printf("%d%c", arr[i], " \n"[i == R]);
  }
}
void Pvec(vector<int> v) {
  for (int i = 0; ((int)(v).size()) > i; i++) {
    printf("%d%c", v[i], " \n"[i == ((int)(v).size()) - 1]);
  }
}
void Sarr(int *arr, int L, int R) {
  for (int i = L; R >= i; i++) {
    scanf("%d", &(arr[i]));
    ;
  }
}
const int N = 2e5 + 6;
const int INF = 0x3f3f3f3f;
int mods[10] = {1000000861, 1000004329, 1000025261, 1000075057, 1000099999,
                1123465789, 1123564987, 1123586479, 1124396857, 1124638579};
pair<long long, long long> operator-(const pair<long long, long long> &p1,
                                     const pair<long long, long long> &p2) {
  return make_pair(p1.first - p2.first, p1.second - p2.second);
}
long long operator^(const pair<long long, long long> &p1,
                    const pair<long long, long long> &p2) {
  return p1.first * p2.second - p1.second * p2.first;
}
long long Val(long long x) {
  if (x > 0)
    return 1;
  else if (x == 0)
    return 0;
  else if (x < 0)
    return -1;
}
void make_tobou(vector<pair<long long, long long> > &v) {
  sort(v.begin(), v.end());
  vector<pair<long long, long long> > dd;
  for (pair<long long, long long> p : v) {
    if (((int)(dd).size()) < 2)
      dd.push_back(p);
    else {
      while (((int)(dd).size()) >= 2 && Val((p - dd[((int)(dd).size()) - 2]) ^
                                            (dd[((int)(dd).size()) - 1] -
                                             dd[((int)(dd).size()) - 2])) >= 0)
        dd.pop_back();
      dd.push_back(p);
    }
  }
  reverse(v.begin(), v.end());
  vector<pair<long long, long long> > uu;
  for (pair<long long, long long> p : v) {
    if (((int)(uu).size()) < 2)
      uu.push_back(p);
    else {
      while (((int)(uu).size()) >= 2 && Val((p - uu[((int)(uu).size()) - 2]) ^
                                            (uu[((int)(uu).size()) - 1] -
                                             uu[((int)(uu).size()) - 2])) >= 0)
        uu.pop_back();
      uu.push_back(p);
    }
  }
  vector<pair<long long, long long> > vv;
  for (pair<long long, long long> p : dd) vv.push_back(p);
  vv.pop_back();
  for (pair<long long, long long> p : uu) vv.push_back(p);
  vv.pop_back();
  v = vv;
}
long long get_area(vector<pair<long long, long long> > all) {
  long long ans = 0;
  for (int i = 1; ((int)(all).size()) - 1 > i; i++) {
    ans += ((all[i] - all[0]) ^ (all[i + 1] - all[0]));
  }
  ans = abs(ans);
  return ans;
}
int n, m;
long long ppow[N];
long long pre1[N], pre2[N];
int xx[5] = {880301, 106111601, 991, 47017, 10430579};
pair<long long, long long> c1 = make_pair(0, 0), c2 = make_pair(0, 0);
long long get_dis(long long x1, long long y1, long long x2, long long y2,
                  long long mod) {
  long long x = ((abs(x1 - x2)) % mod + mod) % mod;
  long long y = ((abs(y1 - y2)) % mod + mod) % mod;
  return (x * x + y * y) % mod;
}
bool solve(vector<pair<long long, long long> > v1,
           vector<pair<long long, long long> > v2, long long X, long long mod1,
           long long mod2) {
  ppow[0] = 1;
  for (int i = 1; (N - 1) >= i; ++i) {
    ppow[i] = (ppow[i - 1] * X) % mod2;
  }
  long long hash1 = 0, hash2 = 0;
  int n = ((int)(v1).size());
  v1.push_back(v1.front());
  for (int i = 1; n >= i; i++) {
    hash1 += ((get_dis(v1[i].first, v1[i].second, v1[i - 1].first,
                       v1[i - 1].second, mod1)) *
              ppow[i]);
    hash1 %= mod2;
    hash2 += ((get_dis(c1.first, c1.second, v1[i - 1].first, v1[i - 1].second,
                       mod1)) *
              ppow[i]);
    hash2 %= mod2;
  }
  for (int i = 0; n > i; i++) {
    v2.push_back(v2[i]);
  }
  v2.push_back(v2.front());
  for (int i = 1; 2 * n >= i; i++) {
    pre1[i] =
        pre1[i - 1] + ((get_dis(v2[i].first, v2[i].second, v2[i - 1].first,
                                v2[i - 1].second, mod1)) *
                       ppow[i]);
    pre1[i] %= mod2;
    pre2[i] = pre2[i - 1] + ((get_dis(c2.first, c2.second, v2[i - 1].first,
                                      v2[i - 1].second, mod1)) *
                             ppow[i]);
    pre2[i] %= mod2;
  }
  for (int i = 1; n >= i; i++) {
    int L = i, R = i + n - 1;
    long long mod = mod2;
    if (((pre1[R] - pre1[L - 1] + mod) % mod) * ppow[N - R] % mod2 ==
        hash1 * ppow[N - n] % mod2) {
      if (((pre2[R] - pre2[L - 1] + mod) % mod) * ppow[N - R] % mod2 ==
          hash2 * ppow[N - n] % mod2)
        return true;
    }
  }
  return false;
}
int main() {
  srand(clock());
  vector<pair<long long, long long> > v1, v2;
  scanf("%d %d", &(n), &(m));
  ;
  for (int i = 1; (n) >= i; ++i) {
    long long x, y;
    scanf("%lld %lld", &(x), &(y));
    ;
    v1.push_back(make_pair(x, y));
  }
  for (int i = 1; (m) >= i; ++i) {
    long long x, y;
    scanf("%lld %lld", &(x), &(y));
    ;
    v2.push_back(make_pair(x, y));
  }
  make_tobou(v1);
  make_tobou(v2);
  if (((int)(v1).size()) != ((int)(v2).size())) {
    puts("NO");
    return 0;
  }
  if (get_area(v1) != get_area(v2)) {
    puts("NO");
    return 0;
  }
  int nn = ((int)(v1).size());
  for (pair<long long, long long> &p : v1) {
    p.first *= nn;
    p.second *= nn;
    c1.first += p.first;
    c1.second += p.second;
  }
  c1.first /= nn;
  c1.second /= nn;
  for (pair<long long, long long> &p : v2) {
    p.first *= nn;
    p.second *= nn;
    c2.first += p.first;
    c2.second += p.second;
  }
  c2.first /= nn;
  c2.second /= nn;
  int ff[5] = {0, 1, 2, 3, 4}, gg[5] = {0, 1, 2, 3, 4}, hh[5] = {0, 1, 2, 3, 4};
  random_shuffle(ff, ff + 5);
  random_shuffle(gg, gg + 5);
  random_shuffle(hh, hh + 5);
  for (int i = 0; 5 > i; i++) {
    if (solve(v1, v2, xx[ff[i]], mods[gg[i]], mods[hh[i] + 5]) == false) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
}