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;
struct vec2l {
  long x, y;
};
string vec_to_str(const vec2l& val) {
  return "(" + to_string(val.x) + ", " + to_string(val.y) + ")";
}
vector<vec2l> read_points(int n) {
  vector<vec2l> result;
  result.reserve(n);
  for (int i = 0; i < n; ++i) {
    vec2l p;
    scanf("%ld %ld", &p.x, &p.y);
    result.push_back(p);
  }
  return result;
}
long long cross_product(const vec2l& a, const vec2l& b) {
  long long ax = static_cast<long long>(a.x);
  long long ay = static_cast<long long>(a.y);
  long long bx = static_cast<long long>(b.x);
  long long by = static_cast<long long>(b.y);
  return (ax * by - bx * ay);
}
long long size_squared(const vec2l& a) {
  long long ax = static_cast<long long>(a.x);
  long long ay = static_cast<long long>(a.y);
  return (ax * ax + ay * ay);
}
long long dot_product(const vec2l& a, const vec2l& b) {
  long long ax = static_cast<long long>(a.x);
  long long ay = static_cast<long long>(a.y);
  long long bx = static_cast<long long>(b.x);
  long long by = static_cast<long long>(b.y);
  return (ax * bx + ay * by);
}
void quick_hull(vector<vec2l>& hull, const vector<vec2l>& points,
                const vec2l& p1, const vec2l& p2) {
  vec2l p{p2.x - p1.x, p2.y - p1.y};
  vector<vec2l> filtered;
  filtered.reserve(points.size());
  long long max_height = -1;
  int highest = -1;
  vec2l max_b;
  for (const auto& point : points) {
    vec2l b{point.x - p1.x, point.y - p1.y};
    long long height = cross_product(p, b);
    if (height > 0) {
      filtered.push_back(point);
      if (height > max_height ||
          (height == max_height && dot_product(p, b) < dot_product(p, max_b))) {
        max_height = height;
        highest = filtered.size() - 1;
        max_b = b;
      }
    }
  }
  if (filtered.size() == 0) {
    hull.push_back(p2);
  } else if (filtered.size() == 1) {
    hull.push_back(filtered[0]);
    hull.push_back(p2);
  } else if (filtered.size() > 1) {
    quick_hull(hull, filtered, p1, filtered[highest]);
    quick_hull(hull, filtered, filtered[highest], p2);
  }
}
vector<vec2l> hull(const vector<vec2l>& points) {
  vector<vec2l> hull;
  hull.reserve(points.size());
  vec2l left = points[0];
  vec2l right = points[0];
  for (const vec2l& point : points) {
    if (point.x < left.x || (point.x == left.x && point.y < left.y)) {
      left = point;
    }
    if (point.x > right.x || (point.x == right.x && point.y > right.y)) {
      right = point;
    }
  }
  if (left.x == right.x) {
    hull.push_back(left);
    if (left.y != right.y) {
      hull.push_back(right);
    }
    return hull;
  }
  quick_hull(hull, points, left, right);
  quick_hull(hull, points, right, left);
  return hull;
}
struct edge {
  long long length_squared;
  long long dot;
};
string edge_to_str(const edge& val) {
  return "(" + to_string(val.length_squared) + ", " + to_string(val.dot) + ")";
}
bool edges_equal(const edge& a, const edge& b) {
  return a.length_squared == b.length_squared && a.dot == b.dot;
}
vector<edge> edge_list(const vector<vec2l>& h) {
  vector<edge> result;
  result.reserve(h.size());
  for (int i = 0; i < h.size(); ++i) {
    vec2l a = h[i];
    vec2l b = h[(i + 1) % h.size()];
    vec2l c = h[(i + 2) % h.size()];
    vec2l ab = {b.x - a.x, b.y - a.y};
    vec2l bc = {c.x - b.x, c.y - b.y};
    result.push_back({size_squared(ab), dot_product(ab, bc)});
  }
  return result;
}
bool list_match(const vector<edge>& a, const vector<edge>& b) {
  vector<int> prefix(b.size(), 0);
  for (int i = 1; i < prefix.size(); ++i) {
    int p = prefix[i - 1];
    while (p >= 0 && !edges_equal(b[i], b[p])) {
      p = (p == 0) ? -1 : prefix[p - 1];
    }
    prefix[i] = p + 1;
  }
  int i = 0;
  int j = 0;
  while (i < a.size()) {
    if (edges_equal(a[i], b[j])) {
      ++i;
      ++j;
      if (j >= b.size()) {
        return true;
      }
    } else {
      if (j > 0) {
        j = prefix[j];
      } else {
        ++i;
      }
    }
  }
  return false;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<vec2l> a = read_points(n);
  vector<vec2l> b = read_points(m);
  vector<vec2l> a_hull = hull(a);
  vector<vec2l> b_hull = hull(b);
  if (a_hull.size() == 1 && b_hull.size() == 1) {
    printf("YES\n");
    return 0;
  } else if (a_hull.size() != b_hull.size()) {
    printf("NO\n");
    return 0;
  }
  vector<edge> a_edges = edge_list(a_hull);
  vector<edge> b_edges = edge_list(b_hull);
  int a_edges_size = a_edges.size();
  a_edges.reserve(a_edges_size * 2);
  for (int i = 0; i < a_edges_size; ++i) {
    a_edges.push_back(a_edges[i]);
  }
  printf(list_match(a_edges, b_edges) ? "YES\n" : "NO\n");
}