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 INF = 0x3F3F3F3F;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
int N, M;
pair<int, int> pts1[MAX], pts2[MAX];
stack<pair<int, int> > h1, h2;
vector<double> hull1, hull2;
int lps[2 * MAX];
inline long long int orientation(pair<int, int> a, pair<int, int> b,
                                 pair<int, int> c) {
  return (long long int)(b.second - a.second) * (c.first - b.first) -
         (long long int)(c.second - b.second) * (b.first - a.first);
}
inline double dist(pair<int, int> p1, pair<int, int> p2) {
  long long int x = p1.first - p2.first, y = p1.second - p2.second;
  return sqrt(x * x + y * y);
}
inline double angle(pair<int, int> p1, pair<int, int> p2, pair<int, int> p3) {
  long long int x1 = p1.first - p2.first, y1 = p1.second - p2.second;
  long long int x2 = p3.first - p2.first, y2 = p3.second - p2.second;
  long long int dot = x1 * x2 + y1 * y2, det = x1 * y2 - y1 * x2;
  double d1 = dist(p1, p2), d2 = dist(p2, p3);
  return atan2(det, dot) * (d1 / d2);
}
inline void popStack(stack<pair<int, int> > &st,
                     vector<pair<int, int> > &hull) {
  while (st.size() > 1) {
    hull.push_back({st.top().first, st.top().second});
    st.pop();
  }
}
void process(pair<int, int> p, stack<pair<int, int> > &st) {
  bool cw = false;
  while (st.size() > 1 && !cw) {
    pair<int, int> b = st.top();
    st.pop();
    pair<int, int> a = st.top();
    if (orientation(a, b, p) > 0) {
      cw = true;
      st.push(b);
    }
  }
  st.push(p);
}
void findHull(int N, pair<int, int> arr[], vector<double> &hull) {
  vector<pair<int, int> > v;
  while (!h1.empty()) {
    h1.pop();
  }
  while (!h2.empty()) {
    h2.pop();
  }
  sort(arr, arr + N);
  for (int i = 0; i < N; i++) {
    process(arr[i], h1);
  }
  for (int i = N - 1; i >= 0; i--) {
    process(arr[i], h2);
  }
  popStack(h1, v);
  popStack(h2, v);
  for (int i = 0; i < v.size(); i++) {
    pair<int, int> p1 = v[i], p2 = v[(i + 1) % v.size()],
                   p3 = v[(i + 2) % v.size()];
    hull.push_back(dist(p1, p2));
    hull.push_back(angle(p1, p2, p3));
  }
}
bool kmp(vector<double> &T, vector<double> &S) {
  int N = (int)S.size(), M = (int)T.size();
  int len = 0;
  lps[0] = 0;
  int i = 1, j = 0;
  while (i < M) {
    if (abs(T[i] - T[len]) < 1e-9) {
      len++;
      lps[i] = len;
      i++;
    } else {
      if (len != 0) {
        len = lps[len - 1];
      } else {
        lps[i] = 0;
        i++;
      }
    }
  }
  i = 0, j = 0;
  while (i < N) {
    if (abs(T[j] - S[i]) < 1e-9) {
      j++, i++;
    }
    if (j == M) {
      return 1;
    } else if (i < N && abs(T[j] - S[i]) > 1e-9) {
      if (j != 0) {
        j = lps[j - 1];
      } else {
        i++;
      }
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &pts1[i].first, &pts1[i].second);
  }
  for (int i = 0; i < M; i++) {
    scanf("%d%d", &pts2[i].first, &pts2[i].second);
  }
  findHull(N, pts1, hull1);
  findHull(M, pts2, hull2);
  if (hull1.size() != hull2.size()) {
    printf("NO\n");
  } else {
    int n = (int)hull1.size();
    for (int i = 0; i < n; i++) {
      hull1.push_back(hull1[i]);
    }
    printf(kmp(hull2, hull1) ? "YES\n" : "NO\n");
  }
  return 0;
}