#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int inf = 2e9;
const int MR = 1e5 + 10;
struct point {
  int x, y;
  bool operator<(const point &p) {
    if (abs(x) != abs(p.x)) return (abs(x) < abs(p.x));
    return (y < p.y);
  }
  point operator-(const point &p) {
    point w;
    w.x = x - p.x;
    w.y = y - p.y;
    return w;
  }
} p, t[MR];
long long det(point p1, point p2) {
  return p1.x * (long long)p2.y - p2.x * (long long)p1.y;
}
bool cmp(point p1, point p2) {
  long long w = det(p1, p2);
  return ((w > 0) || (!w && p1 < p2));
}
vector<point> CH(vector<point> &t) {
  int n = t.size();
  p.x = p.y = inf;
  for (int c = 0; c < n; c++) {
    if (t[c].y < p.y || (t[c].y == p.y && t[c].x < p.x)) p = t[c];
  }
  for (int c = 0; c < n; c++) t[c] = t[c] - p;
  sort(t.begin(), t.end(), cmp);
  vector<point> s;
  s.push_back(t[0]);
  s.push_back(t[1]);
  for (int i = 2; i < n; i++) {
    while ((s.size() >= 2) && (det(s[s.size() - 1] - s[s.size() - 2],
                                   t[i] - s[s.size() - 1]) <= 0))
      s.pop_back();
    s.push_back(t[i]);
  }
  return s;
}
long long sqr(int x) { return x * (long long)x; }
long long dist(point p1, point p2) {
  return sqr(p2.x - p1.x) + sqr(p2.y - p1.y);
}
int P[3 * MR];
void presuf(const vector<pair<long long, long long>> &S) {
  int j;
  P[0] = j = 0;
  for (int i = 1; i < S.size(); i++) {
    while (j && S[j] != S[i]) j = P[j - 1];
    if (S[j] == S[i]) j++;
    P[i] = j;
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<point> Vn, Vm;
  for (int i = 0; i < (n); ++i) {
    scanf("%d%d", &p.x, &p.y);
    Vn.push_back(p);
  }
  for (int i = 0; i < (m); ++i) {
    scanf("%d%d", &p.x, &p.y);
    Vm.push_back(p);
  }
  auto Cn = CH(Vn), Cm = CH(Vm);
  if (Cn.size() != Cm.size()) {
    printf("NO\n");
    return 0;
  }
  int sz = Cn.size();
  vector<pair<long long, long long>> Sn, Sm;
  for (int i = 0; i < (sz); ++i) {
    int prv = (i - 1 + sz) % sz, nxt = (i + 1) % sz;
    Sn.push_back(make_pair(dist(Cn[nxt], Cn[i]),
                           det(Cn[i] - Cn[prv], Cn[nxt] - Cn[prv])));
    Sm.push_back(make_pair(dist(Cm[nxt], Cm[i]),
                           det(Cm[i] - Cm[prv], Cm[nxt] - Cm[prv])));
  }
  Sn.push_back(make_pair(-1, -1));
  for (int i = 0; i < (sz); ++i) Sm.push_back(Sm[i]);
  for (const auto &p : Sm) Sn.push_back(p);
  presuf(Sn);
  for (int i = 0; i < (Sn.size()); ++i)
    if (P[i] == sz) {
      printf("YES\n");
      return 0;
    }
  printf("NO\n");
  return 0;
}
