#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b) { return a + b; }
struct P {
  long long x, y;
  P(long long x = 0, long long y = 0) : x(x), y(y) {}
  P operator+(const P &b) const { return P(add(x, b.x), add(y, b.y)); }
  P operator-(const P &b) const { return P(add(x, -b.x), add(y, -b.y)); }
  P operator*(long long d) const { return P(x * d, y * d); }
  long long operator*(const P &b) const { return add(x * b.x, y * b.y); }
  long long operator^(const P &b) const { return add(x * b.y, -y * b.x); }
  bool operator<(const P &b) const {
    if (x != b.x) return x < b.x;
    return y < b.y;
  }
  bool operator==(const P &b) const { return x == b.x && y == b.y; }
};
vector<P> convex_hull(P *ps, int n) {
  sort(ps, ps + n);
  int k = 0;
  vector<P> qs(2 * n);
  for (int i = 0; i < n; i++) {
    while (k > 1 && ((qs[k - 2] - qs[k - 1]) ^ (ps[i] - qs[k - 1])) >= 0) --k;
    qs[k++] = ps[i];
  }
  for (int i = n - 2, t = k; i >= 0; i--) {
    while (k > t && ((qs[k - 2] - qs[k - 1]) ^ (ps[i] - qs[k - 1])) >= 0) --k;
    qs[k++] = ps[i];
  }
  qs.resize(k - 1);
  return qs;
}
long long dist(P p, P q) { return (p - q) * (p - q); }
const int N = 2e5 + 10;
P a[N], b[2][N];
int len[2];
void calc(vector<P> cv, int ci) {
  len[ci] = cv.size();
  cv.push_back(cv[0]);
  cv.push_back(cv[1]);
  for (int i = 0; i < len[ci]; i++) {
    b[ci][i] = P(dist(cv[i], cv[i + 1]),
                 (cv[i + 1] - cv[i]) * (cv[i + 2] - cv[i + 1]));
  }
}
int getmin(P *s, int n) {
  for (int i = 0; i < n; i++) s[i + n] = s[i];
  int i = 0, j = 1, k = 0;
  while (i < n && j < n && k < n) {
    if (s[i + k] == s[j + k])
      k++;
    else {
      if (s[j + k] < s[i + k])
        i += k + 1;
      else
        j += k + 1;
      if (i == j) j++;
      k = 0;
    }
  }
  return min(i, j);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[i] = P(x, y);
  }
  calc(convex_hull(a, n), 0);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[i] = P(x, y);
  }
  calc(convex_hull(a, m), 1);
  if (len[0] != len[1])
    puts("NO");
  else {
    int x = getmin(b[0], len[0]), y = getmin(b[1], len[1]);
    for (int i = 0; i < n; i++) {
      if (!(b[0][x + i] == b[1][y + i])) {
        puts("NO");
        return 0;
      }
    }
    puts("YES");
  }
}
