#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, y = 0, c = getchar();
  while (!isdigit(c)) y = c, c = getchar();
  while (isdigit(c)) x = x * 10 + (c ^ '0'), c = getchar();
  return y == '-' ? -x : x;
}
void print(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
long long s1 = 19260817, s2 = 23333333, s3 = 998244853, srd;
long long rd() { return srd = (srd * s1 + s2 + rand()) % s3; }
void file() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
int n, m;
struct node {
  long long x, y;
  node(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
} a[100010], b[100010], st1[100010], st2[100010], st3[100010], st4[100010];
int ft1, ft2, ft3, ft4;
node operator+(node q, node w) { return node(q.x + w.x, q.y + w.y); }
node operator-(node q, node w) { return node(q.x - w.x, q.y - w.y); }
bool operator<(node q, node w) { return q.x == w.x ? q.y < w.y : q.x < w.x; }
long long cj(node q, node w) { return q.x * w.y - q.y * w.x; }
long double q1[1000010], q2[1000010];
int p1, p2;
inline int cmp(long double q, long double w) {
  return abs(q - w) < 1e-10l ? 0 : q > w ? 1 : -1;
}
inline long double dis(node q, node w) {
  return sqrtl((q.x - w.x) * (q.x - w.x) + (q.y - w.y) * (q.y - w.y));
}
inline long long len(node q, node w) {
  return (q.x - w.x) * (q.x - w.x) + (q.y - w.y) * (q.y - w.y);
}
int qwq(long double *s, int l) {
  int i = 0, j = 1, k = 0;
  while (i < l && j < l) {
    k = 0;
    while (cmp(s[i + k], s[j + k]) == 0 && k < l) ++k;
    if (k == l) return i;
    if (cmp(s[i + k], s[j + k]) == 1) {
      if (i + k + 1 > j)
        i = i + k + 1;
      else
        i = j + 1;
    } else if (j + k + 1 > i)
      j = j + k + 1;
    else
      j = i + 1;
  }
  if (i < l) return i;
  return j;
}
int main() {
  srand(time(0));
  rd();
  int i, j;
  n = read();
  m = read();
  for (i = 1; i <= n; ++i) {
    a[i].x = read();
    a[i].y = read();
  }
  for (i = 1; i <= m; ++i) {
    b[i].x = read();
    b[i].y = read();
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  for (i = 1; i <= n; ++i) {
    while (ft1 > 1 && cj(a[i] - st1[ft1], st1[ft1 - 1] - st1[ft1]) >= 0) --ft1;
    st1[++ft1] = a[i];
  }
  for (i = n; i; --i) {
    while (ft2 > 1 && cj(a[i] - st2[ft2], st2[ft2 - 1] - st2[ft2]) >= 0) --ft2;
    st2[++ft2] = a[i];
  }
  for (i = 1; i <= m; ++i) {
    while (ft3 > 1 && cj(b[i] - st3[ft3], st3[ft3 - 1] - st3[ft3]) >= 0) --ft3;
    st3[++ft3] = b[i];
  }
  for (i = m; i; --i) {
    while (ft4 > 1 && cj(b[i] - st4[ft4], st4[ft4 - 1] - st4[ft4]) >= 0) --ft4;
    st4[++ft4] = b[i];
  }
  if (ft1 + ft2 != ft3 + ft4) {
    puts("NO");
    return 0;
  }
  if (ft1 == 2 && ft2 == 2) {
    if (len(st1[1], st1[2]) == len(st3[1], st3[2]))
      puts("YES");
    else
      puts("NO");
    return 0;
  }
  st1[0] = st2[ft2 - 1];
  st2[0] = st1[ft1 - 1];
  st3[0] = st4[ft4 - 1];
  st4[0] = st3[ft3 - 1];
  for (i = 1; i < ft1; ++i) {
    q1[p1++] = 1.0l * cj(st1[i] - st1[i + 1], st1[i] - st1[i - 1]) /
                   dis(st1[i], st1[i + 1]) / dis(st1[i], st1[i + 1]) -
               2;
    q1[p1++] = dis(st1[i], st1[i + 1]);
  }
  for (i = 1; i < ft2; ++i) {
    q1[p1++] = 1.0l * cj(st2[i] - st2[i + 1], st2[i] - st2[i - 1]) /
                   dis(st2[i], st2[i + 1]) / dis(st2[i], st2[i + 1]) -
               2;
    q1[p1++] = dis(st2[i], st2[i + 1]);
  }
  for (i = 1; i < ft3; ++i) {
    q2[p2++] = 1.0l * cj(st3[i] - st3[i + 1], st3[i] - st3[i - 1]) /
                   dis(st3[i], st3[i + 1]) / dis(st3[i], st3[i + 1]) -
               2;
    q2[p2++] = dis(st3[i], st3[i + 1]);
  }
  for (i = 1; i < ft4; ++i) {
    q2[p2++] = 1.0l * cj(st4[i] - st4[i + 1], st4[i] - st4[i - 1]) /
                   dis(st4[i], st4[i + 1]) / dis(st4[i], st4[i + 1]) -
               2;
    q2[p2++] = dis(st4[i], st4[i + 1]);
  }
  for (i = 0; i < p1; ++i) q1[i + p1] = q1[i];
  for (i = 0; i < p2; ++i) q2[i + p2] = q2[i];
  int l1 = qwq(q1, p1), l2 = qwq(q2, p2);
  for (i = 0; i < p1; ++i) {
    if (cmp(q1[l1], q2[l2])) {
      puts("NO");
      return 0;
    }
    ++l1;
    ++l2;
    if (l1 == p1) l1 = 0;
    if (l2 == p2) l2 = 0;
  }
  puts("YES");
  return 0;
}
