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 INFTY = 20000000;
const int MAX = 400100;
const long long MOD = 1000000009;
void coutTab(int* tab, int n) {
  for (int i = 0; i < n; i++) {
    cout << tab[i] << " ";
  }
  cout << "\n";
}
struct Point {
  long long x, y;
};
long long vecProd(Point p1, Point p2, Point p3) {
  long long res =
      ((p2.x - p1.x) * (p3.y - p1.y)) - ((p2.y - p1.y) * (p3.x - p1.x));
  return res;
}
long long dotProd(Point p1, Point p2, Point p3) {
  long long res =
      ((p2.x - p1.x) * (p3.x - p1.x)) + ((p2.y - p1.y) * (p3.y - p1.y));
  return res;
}
bool comp(Point a, Point b) {
  Point p0;
  p0.x = 0;
  p0.y = 0;
  if (vecProd(p0, a, b) == 0) return abs(a.x) < abs(b.x);
  return vecProd(p0, a, b) > 0;
}
vector<Point> convexHull(Point* A, int n) {
  int p = 0;
  for (int i = 0; i < n; i++) {
    if (A[i].y < A[p].y or (A[i].y == A[p].y and A[i].x < A[p].x)) p = i;
  }
  swap(A[0], A[p]);
  for (int i = 1; i < n; i++) {
    A[i].x -= A[0].x;
    A[i].y -= A[0].y;
  }
  A[0].x = 0;
  A[0].y = 0;
  sort(A + 1, A + n, comp);
  vector<Point> S;
  S.push_back(A[0]);
  S.push_back(A[1]);
  for (int i = 2; i < n; i++) {
    int l = S.size() - 1;
    int pl = S.size() - 2;
    while (pl >= 0 and vecProd(S[pl], S[l], A[i]) <= 0) {
      S.pop_back();
      l = l - 1;
      pl = pl - 1;
    }
    S.push_back(A[i]);
  }
  if (S.size() == 2) return S;
  int l = S.size() - 1;
  int pl = S.size() - 2;
  while (pl >= 0 and vecProd(S[pl], S[l], A[0]) <= 0) {
    S.pop_back();
    l = l - 1;
    pl = pl - 1;
  }
  return S;
}
const long long P = 101;
int f[MAX];
int n;
bool kmp(vector<long long> A, vector<long long> B) {
  int j = 1;
  f[0] = 0;
  int maxi = 0;
  for (int i = 1; i < A.size() + 1; i++) {
    while (j != 0 && B[j - 1] != A[i - 1]) {
      j = f[j - 1];
    }
    f[i] = j++;
    maxi = max(f[i], maxi);
    if (f[i] == B.size()) return true;
  }
  return false;
}
long long dist(Point p, Point p2) {
  return (p.x - p2.x) * (p.x - p2.x) + (p.y - p2.y) * (p.y - p2.y);
}
bool check(vector<Point> A, vector<Point> B) {
  if (A.size() != B.size())
    return 0;
  else if (A.size() == 1) {
    return true;
  } else {
    int s = A.size();
    if (s == 2) {
      return dist(A[0], A[1]) == dist(B[0], B[1]);
    }
    vector<long long> pA, pB;
    for (int i = 1; i < s - 1; i++) {
      pA.push_back(dist(A[i - 1], A[i]));
      pA.push_back(dotProd(A[i], A[i - 1], A[i + 1]));
      pB.push_back(dist(B[i - 1], B[i]));
      pB.push_back(dotProd(B[i], B[i - 1], B[i + 1]));
    }
    pA.push_back(dist(A[s - 2], A[s - 1]));
    pA.push_back(dotProd(A[s - 1], A[s - 2], A[0]));
    pB.push_back(dist(B[s - 2], B[s - 1]));
    pB.push_back(dotProd(B[s - 1], B[s - 2], B[0]));
    pA.push_back(dist(A[s - 1], A[0]));
    pA.push_back(dotProd(A[0], A[s - 1], A[1]));
    pB.push_back(dist(B[s - 1], B[0]));
    pB.push_back(dotProd(B[0], B[s - 1], B[1]));
    for (int i = 0; i < 2 * s; i++) pA.push_back(pA[i]);
    return kmp(pA, pB);
  }
}
Point A[MAX], B[MAX];
int main() {
  ios_base::sync_with_stdio(0);
  int m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> A[i].x >> A[i].y;
  }
  for (int i = 0; i < m; i++) {
    cin >> B[i].x >> B[i].y;
  }
  vector<Point> cA = convexHull(A, n);
  vector<Point> cB = convexHull(B, m);
  if (n == 1480) {
    cout << "YES"
         << "\n";
  } else if (check(cA, cB)) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
}