#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int INF = 2147483647;
const int mod = 1000000007;
const int mod2 = 998244353;
const double eps = 1e-9;
const double pi = acos(-1.0);
inline int rint() {
  int x;
  scanf("%d", &x);
  return x;
}
inline long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline long long ri64() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
void rvi(vector<int> &a, int n) {
  for (int i = 0; i < n; i++) {
    a.push_back(rint());
  }
}
void rvll(vector<long long> &a, int n) {
  for (int i = 0; i < n; i++) {
    a.push_back(rll());
  }
}
void showvi(vector<int> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%d%c", a[i], (i + 1 == a.size() ? '\n' : ' '));
  }
}
void showvll(vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%lld%c", a[i], (i + 1 == a.size() ? '\n' : ' '));
  }
}
void showviln(vector<int> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%d%c", a[i], '\n');
  }
}
void showvllln(vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) {
    printf("%lld%c", a[i], '\n');
  }
}
void showi(int x) { printf("%d", x); }
long long pw(long long a, long long b, long long c) {
  long long ans = 1;
  long long k = a % c;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * k) % c;
    b = b / 2;
    k = (k * k) % c;
  }
  return ans;
}
const int maxn = 100011;
struct node {
  double x, y;
};
int n;
int tot;
node p[maxn];
node P[maxn];
int tot2;
node P2[maxn];
double X(node A, node B, node C) {
  return (B.x - A.x) * (C.y - A.y) - (C.x - A.x) * (B.y - A.y);
}
double dian(node A, node B, node C) {
  return (B.x - A.x) * (C.x - A.x) + (C.y - A.y) * (B.y - A.y);
}
double len(node A, node B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
bool cmp(node A, node B) {
  double pp = X(p[0], A, B);
  if (pp > 0) return true;
  if (pp < 0) return false;
  if (pp == 0) return len(p[0], A) < len(p[0], B);
}
void build() {
  for (int i = 0; i < n; i++) {
    if (p[i].y < p[0].y) swap(p[i], p[0]);
    if (p[i].y == p[0].y && p[i].x < p[0].x) swap(p[i], p[0]);
  }
  sort(p + 1, p + n, cmp);
  P[0] = p[0];
  P[1] = p[1];
  tot = 1;
  for (int i = 2; i < n; i++) {
    while (tot > 0 && X(P[tot - 1], P[tot], p[i]) <= 0) tot--;
    tot++;
    P[tot] = p[i];
  }
  tot++;
}
int x1[100011];
int asdfeawf[100011];
int x2[100011];
int y2[100011];
int a[400044];
int b[400044];
int ha[400044];
int hb[400044];
int pwb[400044];
const int hmod = 1000000007;
const int mmod = 998244353;
const int base = 233;
int dis(int x1, int asdfeawf, int x2, int y2) {
  int ans = 1LL * (x1 - x2) * (x1 - x2) % mmod +
            1LL * (asdfeawf - y2) * (asdfeawf - y2) % mmod;
  if (ans >= mmod) ans -= mmod;
  return ans;
}
void work() {
  for (int i = 0; i < (tot); i++) {
    x1[i] = P[i].x + 0.1;
    asdfeawf[i] = P[i].y + 0.1;
  }
  for (int i = 0; i < (tot2); i++) {
    x2[i] = P2[i].x + 0.1;
    y2[i] = P2[i].y + 0.1;
  }
  if (tot != tot2) {
    cout << "NO" << '\n';
    return;
  }
  for (int i = 0; i < (tot); i++) {
    int X0 = x1[(i - 1 + tot) % tot];
    int Y0 = asdfeawf[(i - 1 + tot) % tot];
    int X1 = x1[i];
    int Y1 = asdfeawf[i];
    int X2 = x1[(((i) + 1) % (tot))];
    int Y2 = asdfeawf[(((i) + 1) % (tot))];
    int len0 = dis(X0, Y0, X1, Y1);
    int len1 = dis(X1, Y1, X2, Y2);
    a[2 * i + 1] = a[2 * i + 2 * tot + 1] = len1;
    int VX0 = X0 - X1;
    long long VY0 = Y0 - Y1;
    int VX1 = X2 - X1;
    long long VY1 = Y2 - Y1;
    if (VX0 < 0) VX0 += mmod;
    if (VX1 < 0) VX1 += mmod;
    if (VY1 < 0) VY1 += mmod;
    if (VY0 < 0) VY0 += mmod;
    int DOT = (1LL * VX0 * VX1 % mmod + 1LL * VY0 * VY1 % mmod);
    if (DOT >= mmod) DOT -= mod;
    int MUL = 1LL * len0 * len1 % mmod;
    int ANG = 1LL * DOT * pw(MUL, mmod - 2, mmod) % mmod;
    a[2 * i] = a[2 * i + 2 * tot] = ANG;
  }
  for (int i = 0; i < (tot); i++) {
    int X0 = x2[(i - 1 + tot) % tot];
    int Y0 = y2[(i - 1 + tot) % tot];
    int X1 = x2[i];
    int Y1 = y2[i];
    int X2 = x2[(((i) + 1) % (tot))];
    int Y2 = y2[(((i) + 1) % (tot))];
    int len0 = dis(X0, Y0, X1, Y1);
    int len1 = dis(X1, Y1, X2, Y2);
    b[2 * i + 1] = b[2 * i + 2 * tot + 1] = len1;
    int VX0 = X0 - X1;
    long long VY0 = Y0 - Y1;
    int VX1 = X2 - X1;
    long long VY1 = Y2 - Y1;
    if (VX0 < 0) VX0 += mmod;
    if (VX1 < 0) VX1 += mmod;
    if (VY1 < 0) VY1 += mmod;
    if (VY0 < 0) VY0 += mmod;
    int DOT = (1LL * VX0 * VX1 % mmod + 1LL * VY0 * VY1 % mmod);
    if (DOT >= mmod) DOT -= mod;
    int MUL = 1LL * len0 * len1 % mmod;
    int ANG = 1LL * DOT * pw(MUL, mmod - 2, mmod) % mmod;
    b[2 * i] = b[2 * i + 2 * tot] = ANG;
  }
  for (int i = 0; i < (4 * tot); i++) {
    ha[i] = 0;
    if (i) ha[i] = 1LL * ha[i - 1] * base % hmod;
    ha[i] = (ha[i] + a[i]);
    if (ha[i] >= hmod) ha[i] -= hmod;
    hb[i] = 0;
    if (i) hb[i] = 1LL * hb[i - 1] * base % hmod;
    hb[i] = (hb[i] + b[i]);
    if (hb[i] >= hmod) hb[i] -= hmod;
  }
  int h1 = ha[2 * tot - 1];
  for (int i = 0; i < 2 * tot; i += 2) {
    int l = i;
    int r = i + 2 * tot - 1;
    int h2 = hb[r];
    if (l > 0) h2 = h2 - 1LL * hb[l - 1] * pwb[r - l + 1] % hmod;
    if (h2 < 0) h2 += hmod;
    if (h1 == h2) {
      cout << "YES" << '\n';
      return;
    }
  }
  cout << "NO" << '\n';
}
int main() {
  pwb[0] = 1;
  for (int i = 1; i < 400044; i++) pwb[i] = 1LL * pwb[i - 1] * base % hmod;
  int n1, n2;
  scanf("%d%d", &n1, &n2);
  tot = 0;
  n = n1;
  for (int i = 0; i < (n1); i++) {
    p[i].x = rint();
    p[i].y = rint();
  }
  build();
  for (int i = 0; i < (tot); i++) {
    P2[i].x = P[i].x;
    P2[i].y = P[i].y;
  }
  tot2 = tot;
  tot = 0;
  n = n2;
  for (int i = 0; i < (n2); i++) {
    p[i].x = rint();
    p[i].y = rint();
  }
  build();
  work();
}
