#include <bits/stdc++.h>
using namespace std;
struct pt {
  long long x, y;
};
long long S(pt a, pt b, pt c) {
  return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y);
}
bool cmp(pt a, pt b) { return a.x < b.x || a.x == b.x && a.y < b.y; }
bool cw(pt a, pt b, pt c) {
  return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y) < 0;
}
bool ccw(pt a, pt b, pt c) {
  return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y) > 0;
}
void convex_hull(vector<pt> &a) {
  if (a.size() == 1) return;
  sort(a.begin(), a.end(), &cmp);
  pt p1 = a[0], p2 = a.back();
  vector<pt> up, down;
  up.push_back(p1);
  down.push_back(p1);
  for (size_t i = 1; i < a.size(); ++i) {
    if (i == a.size() - 1 || cw(p1, a[i], p2)) {
      while (up.size() >= 2 && !cw(up[up.size() - 2], up[up.size() - 1], a[i]))
        up.pop_back();
      up.push_back(a[i]);
    }
    if (i == a.size() - 1 || ccw(p1, a[i], p2)) {
      while (down.size() >= 2 &&
             !ccw(down[down.size() - 2], down[down.size() - 1], a[i]))
        down.pop_back();
      down.push_back(a[i]);
    }
  }
  a.clear();
  for (size_t i = 0; i < up.size(); ++i) a.push_back(up[i]);
  for (size_t i = down.size() - 2; i > 0; --i) a.push_back(down[i]);
}
void pf(const vector<long long> &s, int need) {
  int n = s.size();
  vector<int> pi(n);
  for (int i = 1; i < n; i++) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) j++;
    pi[i] = j;
    if (j == need) {
      cout << "YES" << endl;
      exit(0);
    }
  }
}
int n, m;
vector<pt> a;
vector<pt> b;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a.push_back({x, y});
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    b.push_back({x, y});
  }
  convex_hull(b);
  convex_hull(a);
  if (a.size() != b.size()) {
    cout << "NO" << endl;
    exit(0);
  }
  vector<long long> s, t;
  int ka = a.size();
  for (int i = 0; i < ka; i++) {
    int j = (i + 1) % ka;
    s.push_back((a[i].x - a[j].x) * (a[i].x - a[j].x) +
                (a[i].y - a[j].y) * (a[i].y - a[j].y));
    int k = (i + 2) % ka;
    s.push_back(S(a[i], a[j], a[k]));
  }
  swap(a, b);
  for (int i = 0; i < ka; i++) {
    int j = (i + 1) % ka;
    t.push_back((a[i].x - a[j].x) * (a[i].x - a[j].x) +
                (a[i].y - a[j].y) * (a[i].y - a[j].y));
    int k = (i + 2) % ka;
    t.push_back(S(a[i], a[j], a[k]));
  }
  int sz = s.size();
  for (int i = 0; i < sz; i++) s.push_back(s[i]);
  t.push_back(1e18);
  for (int i = 0; i < s.size(); i++) t.push_back(s[i]);
  pf(t, 2 * ka);
  cout << "NO" << endl;
}
