#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const int MOD = 1e9 + 7;
struct Point {
  long long x, y;
  void show() { cout << "(" << x << "," << y << ")" << endl; }
} a[MAX], b[MAX], A[MAX], B[MAX];
Point operator+(Point A, Point B) { return (Point){A.x + B.x, A.y + B.y}; }
Point operator-(Point A, Point B) { return (Point){A.x - B.x, A.y - B.y}; }
Point operator*(Point A, long long B) { return (Point){A.x * B, A.y * B}; }
Point operator/(Point A, long long B) { return (Point){A.x / B, A.y / B}; }
long long operator*(Point A, Point B) { return A.x * B.x + A.y * B.y; }
long long operator^(Point A, Point B) { return A.x * B.y - A.y * B.x; }
long long cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
double dis(Point A, Point B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
long long dis2(Point A, Point B) {
  return (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
}
int cmp(const Point& x, const Point& y) {
  if (x.x == y.x) return x.y <= y.y;
  return x.x < y.x;
}
int Tu(Point* p, int n, Point* ch) {
  sort(p, p + n, cmp);
  int m = 0;
  for (int i = 0; i < n; i++) {
    while (m > 1 && cross(ch[m - 1] - ch[m - 2], p[i] - ch[m - 2]) <= 0) m--;
    ch[m++] = p[i];
  }
  int k = m;
  for (int i = n - 2; i >= 0; i--) {
    while (m > k && cross(ch[m - 1] - ch[m - 2], p[i] - ch[m - 2]) <= 0) m--;
    ch[m++] = p[i];
  }
  if (n > 1) m--;
  return m;
}
struct lenka {
  long long a, b, c;
  int operator==(const lenka& d) const {
    return d.a == a && d.b == b && d.c == c;
  }
  int operator!=(const lenka& d) const {
    return d.a != a || d.b != b || d.c != c;
  }
};
vector<lenka> PA, PB;
int f[MAX];
int main() {
  int n, m;
  cin >> 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);
  n = Tu(a, n, A);
  m = Tu(b, m, B);
  if (n != m)
    puts("NO");
  else {
    for (int i = 0; i < n; i++)
      PA.push_back((lenka){dis2(A[(i - 1 + n) % n], A[i]),
                           dis2(A[i], A[(i + 1) % n]),
                           dis2(A[(i - 1 + n) % n], A[(i + 1) % n])});
    for (int i = 0; i < m; i++)
      PB.push_back((lenka){dis2(B[(i - 1 + m) % m], B[i]),
                           dis2(B[i], B[(i + 1) % m]),
                           dis2(B[(i - 1 + m) % m], B[(i + 1) % m])});
    for (int i = 0; i < n; i++) PA.push_back(PA[i]);
    f[0] = f[1] = 0;
    for (int i = 1; i < m; i++) {
      int j = f[i];
      while (j && PB[i] != PB[j]) j = f[j];
      f[i + 1] = (PB[i] == PB[j] ? j + 1 : 0);
    }
    for (int i = 0, j = 0; i < PA.size(); i++) {
      while (j && PA[i] != PB[j]) j = f[j];
      if (PA[i] == PB[j]) j++;
      if (j == m) {
        puts("YES");
        return 0;
      }
    }
    puts("NO");
  }
  return 0;
}
