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;
template <typename T>
using maxHeap = priority_queue<T, vector<T>, less<T>>;
template <typename T>
using minHeap = priority_queue<T, vector<T>, greater<T>>;
template <typename Iter>
ostream& _out(ostream& s, Iter b, Iter e) {
  s << "[";
  for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
  s << "]";
  return s;
}
template <typename A, typename B>
ostream& operator<<(ostream& s, const pair<A, B>& p) {
  return s << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& c) {
  return _out(s, begin(c), end(c));
}
bool debug = 0;
template <typename T>
void DEBUG(const T& x) {
  if (debug) cerr << x;
}
template <typename T, typename... Args>
void DEBUG(const T& head, const Args&... tail) {
  if (debug) {
    cerr << head;
    DEBUG(tail...);
  }
}
template <typename T>
struct Point {
  static constexpr long double EPS = 1e-8;
  T x, y;
  Point(T _ = 0, T __ = 0) : x(_), y(__) {}
  template <typename T2>
  Point(const Point<T2>& a) : x(a.x), y(a.y) {}
  inline long double theta() const {
    return atan2((long double)y, (long double)x);
  }
  inline long double dis() const {
    return hypot((long double)x, (long double)y);
  }
  inline long double dis(const Point& o) const {
    return hypot((long double)(x - o.x), (long double)(y - o.y));
  }
  Point operator-(const Point& o) const { return Point(x - o.x, y - o.y); }
  Point operator-=(const Point& o) {
    x -= o.x, y -= o.y;
    return *this;
  }
  Point operator+(const Point& o) const { return Point(x + o.x, y + o.y); }
  Point operator+=(const Point& o) {
    x += o.x, y += o.y;
    return *this;
  }
  Point operator*(const T& k) const { return Point(x * k, y * k); }
  Point operator*=(const T& k) {
    x *= k, y *= k;
    return *this;
  }
  Point operator/(const T& k) const { return Point(x / k, y / k); }
  Point operator/=(const T& k) {
    x /= k, y /= k;
    return *this;
  }
  Point operator-() const { return Point(-x, -y); }
  Point rot90() const { return Point(-y, x); }
  bool equal(const Point& o, true_type) const {
    return fabs(x - o.x) < EPS and fabs(y - o.y) < EPS;
  }
  bool equal(const Point& o, false_type) const {
    return tie(x, y) == tie(o.x, o.y);
  }
  bool operator==(const Point& o) const {
    return equal(o, is_floating_point<T>());
  }
  bool operator!=(const Point& o) const { return !(*this == o); }
  bool operator<(const Point& o) const { return theta() < o.theta(); }
  friend inline T cross(const Point& a, const Point& b) {
    return a.x * b.y - b.x * a.y;
  }
  friend inline T dot(const Point& a, const Point& b) {
    return a.x * b.x + a.y * b.y;
  }
  friend ostream& operator<<(ostream& ss, const Point& o) {
    ss << "(" << o.x << ", " << o.y << ")";
    return ss;
  }
};
template <typename T>
class ConvexHull_2D {
 private:
  vector<Point<T>> dots;
  struct myhash {
    uint64_t operator()(const Point<T>& a) const {
      uint64_t xx = 0, yy = 0;
      memcpy(&xx, &a.x, sizeof(a.x));
      memcpy(&yy, &a.y, sizeof(a.y));
      uint64_t ret = xx * 17 + yy * 31;
      ret = (ret ^ (ret >> 16)) * 0x9E3779B1;
      ret = (ret ^ (ret >> 13)) * 0xC2B2AE35;
      ret = ret ^ xx;
      return (ret ^ (ret << 3)) * yy;
    }
  };
  unordered_set<Point<T>, myhash> in_hull;

 public:
  inline void init() {
    in_hull.clear();
    dots.clear();
  }
  void insert(const Point<T>& x) { dots.push_back(x); }
  void solve() {
    sort(begin(dots), end(dots), [](const Point<T>& a, const Point<T>& b) {
      return tie(a.x, a.y) < tie(b.x, b.y);
    });
    vector<Point<T>> stk((int)((dots).size()) << 1);
    int top = 0;
    for (auto p : dots) {
      while (top >= 2 and
             cross(p - stk[top - 2], stk[top - 1] - stk[top - 2]) <= 0)
        top--;
      stk[top++] = p;
    }
    for (int i = (int)((dots).size()) - 2, t = top + 1; i >= 0; i--) {
      while (top >= t and
             cross(dots[i] - stk[top - 2], stk[top - 1] - stk[top - 2]) <= 0)
        top--;
      stk[top++] = dots[i];
    }
    stk.resize(top - 1);
    swap(stk, dots);
    for (auto i : stk) in_hull.insert(i);
  }
  vector<Point<T>> get() { return dots; }
  inline bool in_it(const Point<T>& x) {
    return in_hull.find(x) != in_hull.end();
  }
};
using PTL = Point<int64_t>;
ConvexHull_2D<int64_t> cv;
template <typename T>
bool check(const vector<T>&, const vector<T>&);
vector<int64_t> mcp(vector<int64_t> s) {
  int n = (int)((s).size());
  for (int i = 0; i < n; i++) s.push_back(s[i]);
  int i = 0, j = 1;
  while (i < n && j < n) {
    int k = 0;
    while (k < n && s[i + k] == s[j + k]) k++;
    if (s[i + k] <= s[j + k])
      j += k + 1;
    else
      i += k + 1;
    if (i == j) j++;
  }
  int ans = i < n ? i : j;
  return vector<int64_t>(next(s.begin(), ans), next(s.begin(), ans + n));
}
int main(int argc, char* argv[]) {
  if (argc > 1 and string(argv[1]) == "-D") debug = 1;
  if (!debug) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
  auto kill = []() {
    cout << "NO" << '\n';
    exit(0);
  };
  int n, m;
  cin >> n >> m;
  cv.init();
  for (int i = 0; i < n; i++) {
    int64_t x, y;
    cin >> x >> y;
    cv.insert(PTL(x, y));
  }
  cv.solve();
  vector<PTL> one = cv.get();
  cv.init();
  for (int i = 0; i < m; i++) {
    int64_t x, y;
    cin >> x >> y;
    cv.insert(PTL(x, y));
  }
  cv.solve();
  vector<PTL> two = cv.get();
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 221 << " - " << ("one") << "="
         << (one) << '\n';
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 222 << " - " << ("two") << "="
         << (two) << '\n';
  if ((int)((one).size()) != (int)((two).size())) kill();
  vector<int64_t> d1, d2;
  for (int i = 1; i < (int)((one).size()); i++)
    d1.push_back(dot(one[i] - one[i - 1], one[i] - one[i - 1]));
  d1.push_back(dot(one.back() - one[0], one.back() - one[0]));
  for (int i = 1; i < (int)((two).size()); i++)
    d2.push_back(dot(two[i] - two[i - 1], two[i] - two[i - 1]));
  d2.push_back(dot(two.back() - two[0], two.back() - two[0]));
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 231 << " - " << ("d1") << "=" << (d1)
         << '\n';
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 232 << " - " << ("d2") << "=" << (d2)
         << '\n';
  if (!check(d1, d2)) kill();
  vector<int64_t> t1, t2;
  t1.push_back(
      dot(one[0] - one.back(), one[(int)((one).size()) - 2] - one.back()));
  t1.push_back(dot(one[1] - one[0], one.back() - one[0]));
  for (int i = 2; i < (int)((one).size()); i++)
    t1.push_back(dot(one[i] - one[i - 1], one[i - 2] - one[i - 1]));
  t2.push_back(
      dot(two[0] - two.back(), two[(int)((two).size()) - 2] - two.back()));
  t2.push_back(dot(two[1] - two[0], two.back() - two[0]));
  for (int i = 2; i < (int)((two).size()); i++)
    t2.push_back(dot(two[i] - two[i - 1], two[i - 2] - two[i - 1]));
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 243 << " - " << ("t1") << "=" << (t1)
         << '\n';
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 244 << " - " << ("t2") << "=" << (t2)
         << '\n';
  if (!check(t1, t2)) kill();
  cout << "YES" << '\n';
  return 0;
}
template <typename T>
bool check(const vector<T>& a, const vector<T>& b) {
  return mcp(a) == mcp(b);
}