#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-6;
struct Point {
  long long x, y;
  Point(long long int x, long long int y) : x(x), y(y) {}
  Point() {}
  Point operator-(Point p) { return {x - p.x, y - p.y}; }
  Point operator+(Point p) { return {x + p.x, y + p.y}; }
};
long long cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
long long dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
long long len2(Point p) { return p.x * p.x + p.y * p.y; }
Point mn;
bool cmp(Point &a, Point &b) {
  long long c = cross(a - mn, b - mn);
  if (c > 0) return true;
  if (c < 0) return false;
  return len2(a - mn) < len2(b - mn);
}
vector<Point> hull(vector<Point> &a) {
  auto n = (int)a.size();
  mn = a[0];
  for (int i = 1; i < n; i++) {
    if (a[i].y < mn.y || (a[i].y == mn.y && a[i].x < mn.x)) {
      mn = a[i];
    }
  }
  sort(a.begin(), a.end(), cmp);
  vector<Point> st;
  for (auto p : a) {
    while (st.size() >= 2 && cross(st[st.size() - 1] - st[st.size() - 2],
                                   p - st[st.size() - 1]) <= 0) {
      st.pop_back();
    }
    st.push_back(p);
  }
  return st;
}
struct Side {
  long double len, angle;
  Side(long double len, long double angle) : len(len), angle(angle) {}
  Side(Point v1, Point v2) {
    len = hypot(v1.x, v1.y);
    angle = atan2(cross(v1, v2), dot(v1, v2));
  }
};
bool eq(Side &a, Side &b) {
  return abs(a.len - b.len) < EPS && abs(a.angle - b.angle) < EPS;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<Point> a(n), b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i].x >> a[i].y;
  }
  a = hull(a);
  n = (int)a.size();
  for (int i = 0; i < m; i++) {
    cin >> b[i].x >> b[i].y;
  }
  b = hull(b);
  m = (int)b.size();
  vector<Side> s;
  for (int i = 0; i < m; i++) {
    s.emplace_back(b[(i + 1) % m] - b[i], b[(i + 2) % m] - b[(i + 1) % m]);
  }
  s.emplace_back(-1, 0);
  for (int i = 0; i < n; i++) {
    s.emplace_back(a[(i + 1) % n] - a[i], a[(i + 2) % n] - a[(i + 1) % n]);
  }
  for (int i = 0; i < n; i++) {
    s.emplace_back(a[(i + 1) % n] - a[i], a[(i + 2) % n] - a[(i + 1) % n]);
  }
  vector<int> p(s.size());
  int k = 0;
  for (int i = 1; i < p.size(); i++) {
    while (k > 0 && !eq(s[i], s[k])) {
      k = p[k - 1];
    }
    if (eq(s[i], s[k])) {
      k++;
    }
    p[i] = k;
    if (p[i] == m) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
