#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int X = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    X = (X << 3) + (X << 1) + ch - '0', ch = getchar();
  return X * w;
}
struct poi {
  double x, y;
};
typedef poi tub[100007];
int dcmp(double x) {
  if (fabs(x) < 1e-8)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
poi operator+(poi A, poi B) { return (poi){A.x + B.x, A.y + B.y}; }
poi operator-(poi A, poi B) { return (poi){A.x - B.x, A.y - B.y}; }
poi operator*(poi A, double B) { return (poi){A.x * B, A.y * B}; }
poi operator/(poi A, double B) { return (poi){A.x / B, A.y / B}; }
bool operator==(const poi& a, const poi& b) {
  return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) == 0;
}
double Dot(poi A, poi B) { return A.x * B.x + A.y * B.y; }
double Length(poi A) { return sqrt(A.x * A.x + A.y * A.y); }
double Angle(poi A, poi B) { return acos(Dot(A, B) / Length(A) / Length(B)); }
double Cross(poi A, poi B) { return A.x * B.y - A.y * B.x; }
double GetS(poi A, poi B, poi C) { return Cross(B - A, C - A); }
bool operator<(poi a, poi b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
int Tub_maker(poi* p, int x, poi* ch) {
  sort(p, p + x);
  int sum = 0;
  for (int i = 0; i < x; i++) {
    while (sum > 1 &&
           dcmp(Cross(ch[sum - 1] - ch[sum - 2], p[i] - ch[sum - 2])) >= 0) {
      sum--;
    }
    ch[sum++] = p[i];
  }
  int k = sum;
  for (int i = x - 2; i >= 0; i--) {
    while (sum > k &&
           dcmp(Cross(ch[sum - 1] - ch[sum - 2], p[i] - ch[sum - 2])) >= 0) {
      sum--;
    }
    ch[sum++] = p[i];
  }
  if (x > 1) {
    sum--;
  }
  return sum;
}
bool is0(double a, double b) { return fabs(a - b) <= 1e-8; }
int n, m, sum1, sum2, cnts, cntt, nxt[100007 << 1];
bool KmpSearch(double* s, double* p, int sLen, int pLen) {
  int i = 0, j = 0;
  while (i < sLen && j < pLen) {
    if (!is0(s[i], p[j])) {
      if (j == 0) {
        i++;
      }
      j = nxt[j];
    }
    while (j < pLen && is0(s[i], p[j])) {
      i++, j++;
    }
    if (j == pLen) {
      return 1;
    }
  }
  return 0;
}
void Getxext(double* p, int xxt[], int pLen) {
  xxt[0] = -1;
  xxt[1] = 0;
  int j = 0, i = 1;
  for (i = 1; i < pLen; i++) {
    while (j > 0 && !is0(p[i], p[j])) {
      j = xxt[j];
    }
    if (is0(p[i], p[j])) {
      j++;
    }
    xxt[i + 1] = j;
  }
}
tub p1, p2, c1, c2;
double S[100007 << 2], T[100007 << 1];
void print(double* s, int len) {
  for (int i = 0; i < len; i++) {
    printf("%.2lf%c", s[i], i == len - 1 ? '\n' : ' ');
  }
}
int main() {
  n = read(), m = read();
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &p1[i].x, &p1[i].y);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lf%lf", &p2[i].x, &p2[i].y);
  }
  sum1 = Tub_maker(p1, n, c1);
  sum2 = Tub_maker(p2, m, c2);
  if (sum1 != sum2) {
    puts("NO");
    return 0;
  }
  c1[sum1] = c1[0];
  c1[sum1 + 1] = c1[1];
  c2[sum2] = c2[0];
  c2[sum2 + 1] = c2[1];
  for (int i = 0; i < sum1; i++) {
    S[cnts++] = Length(c1[i + 1] - c1[i]);
    S[cnts++] = Angle(c1[i + 2] - c1[i + 1], c1[i + 1] - c1[i]);
  }
  for (int i = 0; i < sum2; i++) {
    T[cntt++] = Length(c2[i + 1] - c2[i]);
    T[cntt++] = Angle(c2[i + 2] - c2[i + 1], c2[i + 1] - c2[i]);
  }
  for (int i = cnts; i < cnts * 2 - 1; i++) {
    S[i] = S[i - cnts];
  }
  Getxext(T, nxt, cntt);
  if (KmpSearch(S, T, cnts * 2 - 2, cntt - 1)) {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}
