#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1E5 + 10;
pair<int64_t, int64_t> p1[MAXN], p2[MAXN], hull1[MAXN], hull2[MAXN],
    norm1[MAXN * 3], norm2[MAXN];
int z[MAXN];
int64_t dist(pair<int64_t, int64_t> a, pair<int64_t, int64_t> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
int64_t cross(pair<int64_t, int64_t> o, pair<int64_t, int64_t> a,
              pair<int64_t, int64_t> b) {
  return (a.first - o.first) * (b.second - o.second) -
         (a.second - o.second) * (b.first - o.first);
}
int convexHull(pair<int64_t, int64_t> *p, pair<int64_t, int64_t> *hull, int n) {
  sort(p, p + n);
  int m = 0;
  for (int i = 0; i < n; i++) {
    while (m >= 2 && cross(hull[m - 2], hull[m - 1], p[i]) <= 0) m--;
    hull[m++] = p[i];
  }
  for (int i = n - 2, t = m; i >= 0; i--) {
    while (m > t && cross(hull[m - 2], hull[m - 1], p[i]) <= 0) m--;
    hull[m++] = p[i];
  }
  return m - 1;
}
void normal(pair<int64_t, int64_t> *hull, pair<int64_t, int64_t> *norm, int n) {
  hull[n] = hull[0], hull[n + 1] = hull[1];
  for (int i = 0; i < n; i++) {
    norm[i] = {dist(hull[i + 1], hull[i + 2]),
               cross(hull[i], hull[i + 1], hull[i + 2])};
  }
}
void zalg(pair<int64_t, int64_t> *str, int len) {
  int l = 0, r = 0;
  for (int i = 0; i < len; i++) {
    if (i > r) {
      l = r = i;
      while (r < len && str[r] == str[r - l]) {
        r++;
      }
      z[i] = r - l;
      r--;
    } else {
      if (z[i - l] < r - i + 1) {
        z[i] = z[i - l];
      } else {
        l = i;
        while (r < len && str[r] == str[r - l]) {
          r++;
        }
        z[i] = r - l;
        r--;
      }
    }
  }
}
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> p1[i].first >> p1[i].second;
  for (int i = 0; i < m; i++) cin >> p2[i].first >> p2[i].second;
  n = convexHull(p1, hull1, n), m = convexHull(p2, hull2, m);
  if (n != m) {
    cout << "NO";
    return 0;
  }
  normal(hull1, norm1, n), normal(hull2, norm2, m);
  for (int i = 0; i < n; i++) norm1[n + i] = norm1[n + n + i] = norm2[i];
  zalg(norm1, n * 3);
  cout << (*max_element(z + 1, z + n * 3) >= n ? "YES" : "NO");
}
