#include <bits/stdc++.h>
using namespace std;
const int N = 1E5 + 10;
struct Point {
  int x, y;
  Point(int _x = 0, int _y = 0) : x(_x), y(_y){};
  bool operator<(const Point &other) const {
    if (x != other.x) return x < other.x;
    return y < other.y;
  }
  Point operator-(const Point &other) {
    return Point(x - other.x, y - other.y);
  }
};
int n, m;
int sz1, sz2;
int pi[N + N];
Point a[N], b[N];
Point hull1[N], hull2[N];
vector<long long> S, T;
void Read_Input() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].x, &a[i].y);
  for (int i = 1; i <= m; i++) scanf("%d%d", &b[i].x, &b[i].y);
}
long long Dot(Point A, Point B) {
  return (long long)A.x * B.x + (long long)A.y * B.y;
}
long long Cross(Point A, Point B) {
  return (long long)A.x * B.y - (long long)A.y * B.x;
}
long long CCW(Point A, Point B, Point C) { return Cross(B - A, C - B); }
long long DAngel(Point A, Point B, Point C) { return Dot(B - A, C - B); }
long long Dist(Point A, Point B) {
  return (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
}
int ConvexHull(int n, Point *a, Point *p) {
  sort(a + 1, a + 1 + n);
  int k = 0;
  for (int i = 1; i <= n; i++) {
    while (k >= 2 && CCW(p[k - 2], p[k - 1], a[i]) <= 0) k--;
    p[k++] = a[i];
  }
  int t = k + 1;
  for (int i = n - 1; i >= 1; i--) {
    while (k >= t && CCW(p[k - 2], p[k - 1], a[i]) <= 0) k--;
    p[k++] = a[i];
  }
  p[k++] = p[1];
  return k - 2;
}
bool KMP() {
  int k = 0;
  for (int i = 2; i < T.size(); i++) {
    while (k > 0 && T[k + 1] != T[i]) k = pi[k];
    if (T[k + 1] == T[i]) k++;
    pi[i] = k;
  }
  k = 0;
  for (int i = 1; i < S.size(); i++) {
    while (k > 0 && T[k + 1] != S[i]) k = pi[k];
    if (T[k + 1] == S[i]) k++;
    if (k == T.size() - 1) return true;
  }
  return false;
}
void Solve() {
  sz1 = ConvexHull(n, a, hull1);
  sz2 = ConvexHull(m, b, hull2);
  if (sz1 != sz2) {
    puts("NO");
    return;
  }
  S.push_back(-1);
  T.push_back(-1);
  for (int i = 0; i < sz1; i++) {
    T.push_back(Dist(hull1[i], hull1[i + 1]));
    T.push_back(DAngel(hull1[i], hull1[i + 1], hull1[i + 2]));
  }
  for (int i = 0; i < sz2; i++) {
    S.push_back(Dist(hull2[i], hull2[i + 1]));
    S.push_back(DAngel(hull2[i], hull2[i + 1], hull2[i + 2]));
  }
  for (int i = 1; i < T.size(); i++) S.push_back(S[i]);
  if (KMP())
    puts("YES");
  else
    puts("NO");
}
int main() {
  Read_Input();
  Solve();
  return 0;
}
