#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\t';
  err(++it, args...);
}
const int NN = 1e5 + 5, mod = 1e9 + 7;
struct point {
  int x, y;
};
point source[2][NN], pivot;
long long int dist2(point a, point b) {
  return ((long long int)a.x - b.x) * (a.x - b.x) +
         ((long long int)a.y - b.y) * ((long long int)a.y - b.y);
}
int ccw(point a, point b, point c) {
  long long int dx1 = b.x - a.x, dx2 = c.x - a.x, dy1 = b.y - a.y,
                dy2 = c.y - a.y;
  if (dx1 * dy2 > dy1 * dx2) return 1;
  if (dx1 * dy2 < dy1 * dx2) return -1;
  return 0;
}
bool ccw_sort(point a, point b) {
  int o = ccw(pivot, a, b);
  if (o == 0) return dist2(pivot, a) > dist2(pivot, b);
  return o > 0;
}
long long int dot(point a, point b) {
  return (long long int)a.x * b.x + (long long int)a.y * b.y;
}
vector<point> convex_hull(point ar[], int n) {
  int i, j;
  for (i = 1; i < n; i++) {
    if (ar[i].y < ar[0].y)
      swap(ar[i], ar[0]);
    else if (ar[i].y == ar[0].y) {
      if (ar[i].x < ar[0].x) swap(ar[i], ar[0]);
    }
  }
  pivot = ar[0];
  sort(ar + 1, ar + n, ccw_sort);
  vector<point> v;
  for (i = 1; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (ccw(ar[0], ar[i], ar[j])) break;
    }
    v.emplace_back(ar[i]);
    i = j - 1;
  }
  int sz = v.size();
  if (sz == 1) {
    return {ar[0], v[0]};
  }
  vector<point> S;
  S.emplace_back(ar[0]);
  S.emplace_back(v[0]);
  S.emplace_back(v[1]);
  point nxt;
  for (i = 2; i < sz; i++) {
    nxt = S[S.size() - 2];
    while (ccw(nxt, S[S.size() - 1], v[i]) <= 0) {
      S.pop_back();
      nxt = S[S.size() - 2];
    }
    S.emplace_back(v[i]);
  }
  return S;
}
string prefix_function(vector<long long int> Z) {
  int n = Z.size(), i;
  int F[n];
  F[0] = 0;
  for (i = 1; Z[i] < 1e18; ++i) {
    int j = F[i - 1];
    while (j > 0 && Z[i] != Z[j]) j = F[j - 1];
    if (Z[i] == Z[j]) ++j;
    F[i] = j;
  }
  F[i] = 0;
  ++i;
  int j, m = i - 1;
  if (Z[i] == Z[0]) {
    F[i] = 1;
  } else {
    F[i] = 0;
  }
  for (++i; i < n; i++) {
    j = F[i - 1];
    while (j > 0 && Z[i] != Z[j]) j = F[j - 1];
    if (Z[i] == Z[j]) ++j;
    F[i] = j;
    if (F[i] == m) return "YES";
  }
  return "NO";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, i, j, k;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> j >> k;
    source[0][i] = {j, k};
  }
  for (i = 0; i < m; i++) {
    cin >> j >> k;
    source[1][i] = {j, k};
  }
  vector<point> con1 = convex_hull(source[0], n);
  vector<point> con2 = convex_hull(source[1], m);
  con1.insert(con1.end(), con1.begin(), con1.end());
  vector<long long int> sas1;
  for (i = 0; i < con1.size() - 1; i++) {
    if (i > 0 && i < con1.size() - 1) {
      long long int d =
          dot({con1[i].x - con1[i - 1].x, con1[i].y - con1[i - 1].y},
              {con1[i + 1].x - con1[i].x, con1[i + 1].y - con1[i].y});
      sas1.emplace_back(d);
    }
    sas1.emplace_back(dist2(con1[i], con1[i + 1]));
  }
  vector<long long int> sas2;
  for (i = 0; i < con2.size() - 1; i++) {
    if (i > 0 && i < con2.size() - 1) {
      long long int d =
          dot({con2[i].x - con2[i - 1].x, con2[i].y - con2[i - 1].y},
              {con2[i + 1].x - con2[i].x, con2[i + 1].y - con2[i].y});
      sas2.emplace_back(d);
    }
    sas2.emplace_back(dist2(con2[i], con2[i + 1]));
  }
  sas2.push_back(1e18);
  sas2.insert(sas2.end(), sas1.begin(), sas1.end());
  cout << prefix_function(sas2);
  return 0;
}
