#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
typedef struct point {
  long long x, y;
  point(long long _x = 0, long long _y = 0) : x(_x), y(_y) {}
  bool operator<(const point &B) const { return x != B.x ? x < B.x : y < B.y; }
  point operator-(const point &B) const { return point(x - B.x, y - B.y); }
  long long operator*(const point &B) const { return x * B.y - y * B.x; }
  long long len_2() { return x * x + y * y; }
} P;
bool cmp(point &A, point &B) {
  return A * B != 0 ? A * B > 0 : A.len_2() < B.len_2();
}
void _sort(point A[], point B[], int len) {
  sort(A, A + len);
  for (int i = 1; i < len; i++) {
    B[i] = A[i] - A[0];
  }
  sort(B + 1, B + len, cmp);
  B[0] = point(0, 0);
}
int ConvexHull(point A[], point B[], int len) {
  _sort(A, A, len);
  int tot = 0;
  for (int i = 0; i < len; i++) {
    if (tot <= 1)
      B[tot++] = A[i];
    else {
      while (tot >= 2 && (B[tot - 1] - B[tot - 2]) * (A[i] - B[tot - 2]) <= 0)
        tot--;
      B[tot++] = A[i];
    }
  }
  return tot;
}
P A[maxn], B[maxn], A1[maxn], B1[maxn];
int len1, len2;
int n, m;
tuple<long long, long long, long long> X[maxn * 2], Y[maxn];
void GetNextval(tuple<long long, long long, long long> p[], int next[],
                int pLen) {
  next[0] = -1;
  int k = -1;
  int j = 0;
  while (j < pLen) {
    if (k == -1 || p[j] == p[k]) {
      ++j, ++k;
      if (p[j] != p[k]) {
        next[j] = k;
      } else {
        next[j] = next[k];
      }
    } else {
      k = next[k];
    }
  }
}
int nxt[123456];
int KmpSearch(tuple<long long, long long, long long> s[],
              tuple<long long, long long, long long> p[], int sLen, int pLen) {
  memset(nxt, -1, sizeof(nxt));
  GetNextval(p, nxt, pLen);
  int i = 0, j = 0;
  while (i < sLen && j < pLen) {
    if (j == -1 || s[i] == p[j]) {
      i++, j++;
    } else {
      j = nxt[j];
    }
  }
  if (j == pLen) {
    return i - j;
  } else {
    return -1;
  }
}
void kmp(point A[], point B[], int len) {
  for (int i = 0; i < len; i++) {
    X[i] = tuple<long long, long long, long long>(
        (A[(i - 1 + len) % len] - A[i]).len_2(),
        (A[(i + 1) % len] - A[i]).len_2(),
        (A[(i - 1 + len) % len] - A[i]) * (A[(i + 1) % len] - A[i]));
    X[i + len] = X[i];
  }
  for (int i = 0; i < len; i++) {
    Y[i] = tuple<long long, long long, long long>(
        (B[(i - 1 + len) % len] - B[i]).len_2(),
        (B[(i + 1) % len] - B[i]).len_2(),
        (B[(i - 1 + len) % len] - B[i]) * (B[(i + 1) % len] - B[i]));
  }
  if (KmpSearch(X, Y, 2 * len, len) != -1)
    puts("YES");
  else
    puts("NO");
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", &A[i].x, &A[i].y);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld%lld", &B[i].x, &B[i].y);
  }
  len1 = ConvexHull(A, A1, n);
  len2 = ConvexHull(B, B1, m);
  if (len1 == len2)
    kmp(A1, B1, len1);
  else
    puts("NO");
  return 0;
}
