#include <bits/stdc++.h>
using namespace std;
inline int inn() {
  int x, ch;
  while ((ch = getchar()) < '0' || ch > '9')
    ;
  x = ch ^ '0';
  while ((ch = getchar()) >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ '0');
  return x;
}
inline int sgn(long long x) { return (x < 0) ? -1 : (x > 0); }
inline int sgn(long long x, long long y) { return sgn(x - y); }
inline long long gabs(long long x) { return x < 0 ? -x : x; }
struct P {
  long long x, y;
  P(long long _x = 0, long long _y = 0) { x = _x, y = _y; }
  inline P operator=(const P &p) {
    x = p.x, y = p.y;
    return *this;
  }
  inline bool operator<(const P &p) const {
    return sgn(x - p.x) ? x < p.x : y < p.y;
  }
  inline P operator+(const P &p) const { return P(x + p.x, y + p.y); }
  inline P operator-(const P &p) const { return P(x - p.x, y - p.y); }
  inline int init() { return x = inn(), y = inn(), 0; }
};
inline long long dot(const P &v1, const P &v2) {
  return v1.x * v2.x + v1.y * v2.y;
}
inline long long dot(const P &s, const P &p1, const P &p2) {
  return dot(p1 - s, p2 - s);
}
inline long long cross(const P &v1, const P &v2) {
  return v1.x * v2.y - v1.y * v2.x;
}
inline long long cross(const P &s, const P &p1, const P &p2) {
  return cross(p1 - s, p2 - s);
}
inline long long Len2(const P &v) { return dot(v, v); }
inline vector<P> convexHull(vector<P> ps, int need_sort = 1) {
  int n = (int)ps.size();
  if (n <= 1) return ps;
  vector<P> ans(2 * n);
  int k = 0;
  if (need_sort) sort(ps.begin(), ps.end());
  for (int i = 0; i < n; ans[k++] = ps[i++])
    while (k > 1 && sgn(cross(ans[k - 2], ans[k - 1], ps[i])) <= 0) k--;
  for (int i = n - 1, t = k; i >= 0; ans[k++] = ps[i--])
    while (k > t && sgn(cross(ans[k - 2], ans[k - 1], ps[i])) <= 0) k--;
  ans.resize(k - 1);
  return ans;
}
vector<P> A, B;
inline int getList(vector<P> &ps, long long *S) {
  int ss = 0, n = (int)ps.size();
  for (int i = 0; i < n; i++) {
    P A = ps[(i + 1) % n], B = ps[i], C = ps[(i + 2) % n];
    S[++ss] = Len2(B - A), S[++ss] = cross(A, B, C);
  }
  return ss;
}
int nxt[1000010];
long long S[1000010], T[1000010];
inline int getnxt(long long *s, int n) {
  for (int i = 2; i <= n; i++) {
    int &j = nxt[i];
    j = nxt[i - 1];
    while (j && sgn(s[j + 1] - s[i])) j = nxt[j];
    if (sgn(s[j + 1] - s[i]) == 0) j++;
  }
  return 0;
}
inline int ocr(long long *s, int n, long long *t, int m) {
  for (int i = 1, j = 0; i <= n; i++) {
    while (j && sgn(t[j + 1] - s[i])) j = nxt[j];
    if (sgn(t[j + 1] - s[i]) == 0) j++;
    if (j == m) return 1;
  }
  return 0;
}
int main() {
  int n = inn(), m = inn();
  A.resize(n), B.resize(m);
  for (int i = 0; i < n; i++) A[i].init();
  for (int i = 0; i < m; i++) B[i].init();
  A = convexHull(A), B = convexHull(B);
  if (A.size() != B.size()) return !printf("NO\n");
  int slen = getList(A, S), tlen = getList(B, T);
  for (int i = slen + 1; i < slen * 2; i++) S[i] = S[i - slen];
  slen = slen * 2 - 1, getnxt(T, tlen);
  if (ocr(S, slen, T, tlen)) return !printf("YES\n");
  return !printf("no\n");
}
