#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int MOD = 1000000007;
const int UNDEF = -1;
const int INF = 1 << 30;
template <typename T>
inline bool chkmax(T &aa, T bb) {
  return aa < bb ? aa = bb, true : false;
}
template <typename T>
inline bool chkmin(T &aa, T bb) {
  return aa > bb ? aa = bb, true : false;
}
int rint();
char rch();
long long rlong();
long long len2(pair<int, int> a, pair<int, int> b) {
  long long dx = a.first - b.first;
  long long dy = a.second - b.second;
  return dx * dx + dy * dy;
}
long long ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  b.first -= a.first;
  b.second -= a.second;
  c.first -= a.first;
  c.second -= a.second;
  return b.first * (long long)c.second - c.first * (long long)b.second;
}
long long dot(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  return (a.first - b.first) * (long long)(c.first - b.first) +
         (a.second - b.second) * (long long)(c.second - b.second);
}
vector<pair<int, int> > convexHull(vector<pair<int, int> > dat) {
  vector<pair<int, int> > upper, lower;
  sort(dat.begin(), dat.end());
  for (int i = 0; i < dat.size(); i++) {
    while (upper.size() >= 2 &&
           ccw(*++upper.rbegin(), *upper.rbegin(), dat[i]) >= 0)
      upper.pop_back();
    while (lower.size() >= 2 &&
           ccw(*++lower.rbegin(), *lower.rbegin(), dat[i]) <= 0)
      lower.pop_back();
    upper.emplace_back(dat[i]);
    lower.emplace_back(dat[i]);
  }
  upper.insert(upper.end(), ++lower.rbegin(), --lower.rend());
  return upper;
}
vector<pair<long long, long long> > serialize(vector<pair<int, int> > v) {
  int n = v.size();
  vector<pair<long long, long long> > vans;
  for (int i = 0; i < n; i++) {
    int k = (i + 1);
    if (k >= n) k -= n;
    int p = (i - 1);
    if (p < 0) p += n;
    long long cw = dot(v[p], v[i], v[k]);
    long long len = len2(v[i], v[k]);
    vans.push_back(make_pair(cw, len));
  }
  return vans;
}
vector<pair<long long, long long> > b;
int bins(pair<long long, long long> key) {
  int imin = 0, imax = b.size();
  while (imin < imax) {
    int imid = (imin + imax) >> 1;
    if (b[imid] < key)
      imin = imid + 1;
    else
      imax = imid;
  }
  return imin;
}
class KMP {
 public:
  vector<int> fail;
  vector<int> p;
  int gm;
  int dfa(int j, int x) {
    ++j;
    while (j > 0 && x != p[j - 1]) {
      j = fail[j];
    }
    return j;
  }
  void buildfail() {
    int m = gm;
    int j = 0;
    for (int i = 1; i <= m; i++) {
      fail[i] = j;
      while (j > 0 && p[i - 1] != p[j - 1]) {
        j = fail[j];
      }
      j++;
    }
    fail[m + 1] = j;
  }
  void init(vector<int> pattern) {
    int m = pattern.size();
    gm = m;
    fail.resize(m + 2);
    p = pattern;
    buildfail();
  }
};
KMP kmp;
int n[2];
vector<pair<long long, long long> > g[2];
vector<int> q[2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int t = 0; t < 2; t++) n[t] = rint();
  for (int t = 0; t < 2; t++) {
    vector<pair<int, int> > v;
    v.reserve(n[t]);
    for (int i = 0; i < n[t]; i++) {
      v.push_back(make_pair(rint(), rint()));
    }
    g[t] = serialize(convexHull(v));
  }
  b = g[0];
  for (auto &w : g[1]) b.push_back(w);
  sort(b.begin(), b.end());
  auto it = unique(b.begin(), b.end());
  b.resize(it - b.begin());
  for (int t = 0; t < 2; t++) {
    q[t].reserve(g[t].size());
    for (auto &w : g[t]) {
      q[t].push_back(bins(w));
    }
  }
  kmp.init(q[0]);
  int x = 0;
  for (int k = 0; k < 2; k++) {
    for (auto &w : q[1]) {
      x = kmp.dfa(x, w);
      if (x == q[0].size()) {
        printf("YES\n");
        exit(0);
      }
    }
  }
  printf("NO\n");
}
static char stdinBuffer[1024];
static char *stdinDataEnd = stdinBuffer + sizeof(stdinBuffer);
static const char *stdinPos = stdinDataEnd;
void readAhead(size_t amount) {
  size_t remaining = stdinDataEnd - stdinPos;
  if (remaining < amount) {
    memmove(stdinBuffer, stdinPos, remaining);
    size_t sz = fread(stdinBuffer + remaining, 1,
                      sizeof(stdinBuffer) - remaining, stdin);
    stdinPos = stdinBuffer;
    stdinDataEnd = stdinBuffer + remaining + sz;
    if (stdinDataEnd != stdinBuffer + sizeof(stdinBuffer)) *stdinDataEnd = 0;
  }
}
int rint() {
  readAhead(16);
  int x = 0;
  bool neg = false;
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  if (*stdinPos == '-') {
    ++stdinPos;
    neg = true;
  }
  while (*stdinPos >= '0' && *stdinPos <= '9') {
    x *= 10;
    x += *stdinPos - '0';
    ++stdinPos;
  }
  return neg ? -x : x;
}
char rch() {
  readAhead(16);
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  char ans = *stdinPos;
  ++stdinPos;
  return ans;
}
long long rlong() {
  readAhead(32);
  long long x = 0;
  bool neg = false;
  while (*stdinPos == ' ' || *stdinPos == '\n') ++stdinPos;
  if (*stdinPos == '-') {
    ++stdinPos;
    neg = true;
  }
  while (*stdinPos >= '0' && *stdinPos <= '9') {
    x *= 10;
    x += *stdinPos - '0';
    ++stdinPos;
  }
  return neg ? -x : x;
}
