#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct tpoint {
  long long x, y;
  tpoint() {}
  tpoint(long long _x, long long _y) : x(_x), y(_y) {}
} p1[N], hu1[N], p2[N], hu2[N];
tpoint operator-(tpoint a, tpoint b) { return tpoint(a.x - b.x, a.y - b.y); }
long long cross(tpoint a, tpoint b) { return a.x * b.y - b.x * a.y; }
bool operator<(const tpoint &a, const tpoint &b) {
  return a.x < b.x || (a.x == b.x && a.y < b.y);
}
int andrew(int n, tpoint hull[], tpoint p[]) {
  sort(p, p + n);
  int m = 0, k;
  for (int i = 0; i < (n); ++i) {
    while (m > 1 && cross(hull[m - 1] - hull[m - 2], p[i] - hull[m - 2]) <= 0)
      m--;
    hull[m++] = p[i];
  }
  k = m;
  for (int i = n - 1; i >= 0; --i) {
    while (m > k && cross(hull[m - 1] - hull[m - 2], p[i] - hull[m - 2]) <= 0)
      m--;
    hull[m++] = p[i];
  }
  if (n > 1) m--;
  return m;
}
long long dot(tpoint a, tpoint b, tpoint c) {
  return (b.x - a.x) * (c.x - a.x) + (b.y - a.y) * (c.y - a.y);
}
long long dis(tpoint a, tpoint b) {
  long long xx = (a.x - b.x);
  long long yy = (a.y - b.y);
  return xx * xx + yy * yy;
}
long long a1[N * 6], a2[N * 6];
long long di1[N * 2], di2[N * 2];
int nex[N * 2];
void cal_next(long long s[], int len) {
  nex[0] = -1;
  int k = -1;
  for (int q = 1; q < (len); ++q) {
    while (k > -1 && s[k + 1] != s[q]) k = nex[k];
    if (s[k + 1] == s[q]) k++;
    nex[q] = k;
  }
}
int kmp(long long *str, int slen, long long *ptr, int plen) {
  memset(nex, 0, sizeof(nex));
  cal_next(ptr, plen);
  int k = -1;
  for (int i = 0; i < (slen); ++i) {
    while (k > -1 && ptr[k + 1] != str[i]) k = nex[k];
    if (ptr[k + 1] == str[i]) k++;
    if (k == plen - 1) {
      return 1;
    }
  }
  return 0;
}
int main() {
  int n, m, k1, k2;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (n); ++i) {
    scanf("%lld%lld", &p1[i].x, &p1[i].y);
  }
  k1 = andrew(n, hu1, p1);
  for (int i = 0; i < (m); ++i) {
    scanf("%lld%lld", &p2[i].x, &p2[i].y);
  }
  k2 = andrew(m, hu2, p2);
  if (k1 != k2) {
    cout << "NO" << endl;
    return 0;
  }
  int top1 = 0, top2 = 0;
  for (int i = 0; i < (k1); ++i) {
    a1[top1++] = dis(hu1[(i - 1 + k1) % k1], hu1[i]);
    a1[top1++] = dot(hu1[i], hu1[(i - 1 + k1) % k1], hu1[(i + 1) % k1]);
    a1[top1++] = dis(hu1[(i + 1) % k1], hu1[i]);
  }
  for (int i = 0; i < (k2); ++i) {
    a2[top2++] = dis(hu2[(i - 1 + k2) % k2], hu2[i]);
    a2[top2++] = dot(hu2[i], hu2[(i - 1 + k2) % k2], hu2[(i + 1) % k2]);
    a2[top2++] = dis(hu2[(i + 1) % k2], hu2[i]);
  }
  for (int i = top1; i < (top1 * 2); ++i) a1[i] = a1[i - top1];
  int fg1 = kmp(a1, 2 * top1, a2, top2);
  if (fg1) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
