#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101010;
class Point {
 public:
  int x, y;
  Point(int x = 0, int y = 0) : x(x), y(y) {}
  Point operator-(const Point &b) { return Point(x - b.x, y - b.y); }
  long long len2() { return 1ll * x * x + 1ll * y * y; }
} a[MAXN], b[MAXN], aa[MAXN], bb[MAXN];
bool cmp(const Point &a, const Point &b) {
  return a.x == b.x ? a.y < b.y : a.x < b.x;
}
long long det(const Point &a, const Point &b) {
  return 1ll * a.x * b.y - 1ll * a.y * b.x;
}
int calc(Point *a, Point *b, int n) {
  sort(a + 1, a + n + 1, cmp);
  int top = 1;
  b[1] = a[1];
  for (int i = 2; i <= n; ++i) {
    while (top >= 2 && det(b[top] - b[top - 1], a[i] - b[top]) <= 0) --top;
    b[++top] = a[i];
  }
  int lst = top;
  for (int i = n - 1; i; --i) {
    while (top > lst && det(b[top] - b[top - 1], a[i] - b[top]) <= 0) --top;
    b[++top] = a[i];
  }
  return --top;
}
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &aa[i].x, &aa[i].y);
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &bb[i].x, &bb[i].y);
  }
  n = calc(aa, a, n);
  m = calc(bb, b, m);
  if (n != m) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    bool flag = 1;
    for (int j = 1, st = i, lst = n, nxt = 2, lst1 = (st == 1 ? n : st - 1),
             nxt1 = (st == n ? 1 : st + 1);
         j <= n;
         ++j, st = (st % n) + 1, lst = (lst % n) + 1, lst1 = (lst1 % n) + 1,
             nxt = (nxt % n) + 1, nxt1 = (nxt1 % n) + 1) {
      if ((a[j] - a[lst]).len2() != (b[st] - b[lst1]).len2()) {
        flag = 0;
        break;
      }
      if (det(a[nxt] - a[j], a[j] - a[lst]) !=
          det(b[nxt1] - b[st], b[st] - b[lst1])) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
