#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
struct Point {
  long long x, y;
};
inline Point operator+(Point a, Point b) {
  return (Point){a.x + b.x, a.y + b.y};
}
inline Point operator-(Point a, Point b) {
  return (Point){a.x - b.x, a.y - b.y};
}
inline long long cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
inline double dis(Point a, Point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
inline bool cmp(Point a, Point b) { return a.x != b.x ? a.x < b.x : a.y < b.y; }
inline vector<Point> gethull(vector<Point> vec) {
  sort(vec.begin(), vec.end(), cmp);
  vector<Point> stk;
  stk.clear();
  for (int i = 0; i < vec.size(); i++) {
    while (stk.size() > 1 &&
           cross(vec[i] - stk[stk.size() - 1],
                 stk[stk.size() - 1] - stk[stk.size() - 2]) <= 0)
      stk.pop_back();
    stk.push_back(vec[i]);
  }
  int tmp = stk.size();
  for (int i = vec.size() - 1; i >= 0; i--) {
    while (stk.size() > tmp &&
           cross(vec[i] - stk[stk.size() - 1],
                 stk[stk.size() - 1] - stk[stk.size() - 2]) <= 0)
      stk.pop_back();
    stk.push_back(vec[i]);
  }
  stk.pop_back();
  return stk;
}
double getang(const Point &o, const Point &a, const Point &b) {
  Point t1, t2;
  double theta;
  t1.x = a.x - o.x, t1.y = a.y - o.y;
  t2.x = b.x - o.x, t2.y = b.y - o.y;
  theta = atan2((double)t2.y, (double)t2.x) - atan2((double)t1.y, (double)t1.x);
  if (theta < 0) theta += 2.0 * pi;
  return theta;
}
int main() {
  int n, m;
  vector<Point> a, b;
  scanf("%d%d", &n, &m);
  a.resize(n);
  b.resize(m);
  for (int i = 0; i < n; i++) scanf("%I64d%I64d", &a[i].x, &a[i].y);
  for (int i = 0; i < m; i++) scanf("%I64d%I64d", &b[i].x, &b[i].y);
  a = gethull(a);
  b = gethull(b);
  if (a.size() != b.size()) return puts("NO"), 0;
  vector<double> A, B;
  for (int i = 0; i < a.size(); i++)
    A.push_back(dis(a[i], a[(i + 1) % a.size()])),
        A.push_back(getang(a[i], a[(i - 1 + a.size()) % a.size()],
                           a[(i + 1) % a.size()]));
  for (int i = 0; i < b.size(); i++)
    B.push_back(dis(b[i], b[(i + 1) % b.size()])),
        B.push_back(getang(b[i], b[(i - 1 + b.size()) % b.size()],
                           b[(i + 1) % b.size()]));
  for (int i = 0; i < A.size(); i++) {
    bool flag = true;
    for (int j = 0; j < A.size(); j++)
      if (fabs(A[j] - B[(i + j) % A.size()]) > (1e-8)) {
        flag = false;
        break;
      }
    if (flag) return puts("YES"), 0;
  }
  puts("NO");
  return 0;
}
