#include <bits/stdc++.h>
using namespace std;
const int mod = (1e9) + 7;
const double eps = 1e-6;
const int siz = 1e5 + 5, siz2 = 1e5 + 5;
long long mul(long long a, long long b) { return a * b; }
struct point {
  int x, y, i;
  point min(point &p) {
    if (x != p.x) {
      if (x < p.x) {
        return *this;
      }
      return p;
    }
    if (y < p.y) {
      return *this;
    }
    return p;
  }
  point max(point &p) {
    if (x != p.x) {
      if (x > p.x) {
        return *this;
      }
      return p;
    }
    if (y > p.y) {
      return *this;
    }
    return p;
  }
  bool eq(point &p) { return x == p.x && y == p.y; }
};
bool cmp(point &a, point &b) {
  if (a.x != b.x) {
    return a.x < b.x;
  }
  return a.y < b.y;
}
int cross(point &a, point &b, point &c) {
  point ab = {b.x - a.x, b.y - a.y}, ac = {c.x - a.x, c.y - a.y};
  long long res = mul(ab.x, ac.y) - mul(ac.x, ab.y);
  return res > 0 ? 1 : (res < 0 ? -1 : 0);
}
long long dot(point &a, point &b, point &c) {
  point ba = {a.x - b.x, a.y - b.y}, bc = {c.x - b.x, c.y - b.y};
  return mul(ba.x, bc.x) + mul(ba.y, bc.y);
}
int nxt(int i, int sz) { return (i + 1) % sz; }
int prv(int i, int sz) { return (i - 1 + sz) % sz; }
void adjust(vector<point> &ps) {
  int sz = ps.size();
  for (int i = 0; i < sz; i++) {
    ps[i].i = i;
  }
}
vector<point> merge(vector<point> &lft_ch, vector<point> &rit_ch) {
  point mx_l = {INT_MIN, INT_MIN, -1}, mn_r = {INT_MAX, INT_MAX, -1};
  for (auto &p : lft_ch) {
    mx_l = mx_l.max(p);
  }
  for (auto &p : rit_ch) {
    mn_r = mn_r.min(p);
  }
  point up_l = mx_l, up_r = mn_r, down_l = mx_l, down_r = mn_r;
  int sz_l = lft_ch.size(), sz_r = rit_ch.size();
  point temp_r = {INT_MAX}, temp_l = {INT_MAX};
  while (true) {
    bool done = true;
    if (sz_r != 1) {
      int c = cross(up_l, up_r, rit_ch[prv(up_r.i, sz_r)]);
      if (c >= 0) {
        if (c == 1 || !temp_r.eq(rit_ch[prv(up_r.i, sz_r)])) {
          if (c == 0 && temp_r.x == INT_MAX) {
            temp_r = up_r;
          }
          done = false;
          up_r = rit_ch[prv(up_r.i, sz_r)];
        }
      }
    }
    if (sz_l != 1) {
      int c = cross(up_r, up_l, lft_ch[nxt(up_l.i, sz_l)]);
      if (c <= 0) {
        if (c == -1 || !temp_l.eq(lft_ch[nxt(up_l.i, sz_l)])) {
          if (c == 0 && temp_l.x == INT_MAX) {
            temp_l = up_l;
          }
          done = false;
          up_l = lft_ch[nxt(up_l.i, sz_l)];
        }
      }
    }
    if (done) {
      break;
    }
  }
  temp_r = {INT_MAX};
  temp_l = {INT_MAX};
  while (true) {
    bool done = true;
    if (sz_r != 1) {
      int c = cross(down_l, down_r, rit_ch[nxt(down_r.i, sz_r)]);
      if (c <= 0) {
        if (c == -1 || !temp_r.eq(rit_ch[nxt(down_r.i, sz_r)])) {
          if (c == 0 && temp_r.x == INT_MAX) {
            temp_r = down_r;
          }
          done = false;
          down_r = rit_ch[nxt(down_r.i, sz_r)];
        }
      }
    }
    if (sz_l != 1) {
      int c = cross(down_r, down_l, lft_ch[prv(down_l.i, sz_l)]);
      if (c >= 0) {
        if (c == 1 || !temp_l.eq(lft_ch[prv(down_l.i, sz_l)])) {
          if (c == 0 && temp_l.x == INT_MAX) {
            temp_l = down_l;
          }
          done = false;
          down_l = lft_ch[prv(down_l.i, sz_l)];
        }
      }
    }
    if (done) {
      break;
    }
  }
  vector<point> ret_ch;
  while (true) {
    ret_ch.push_back(up_l);
    if (up_l.eq(down_l)) {
      break;
    }
    up_l = lft_ch[nxt(up_l.i, sz_l)];
  }
  while (true) {
    ret_ch.push_back(down_r);
    if (down_r.eq(up_r)) {
      break;
    }
    down_r = rit_ch[nxt(down_r.i, sz_r)];
  }
  adjust(ret_ch);
  return ret_ch;
}
vector<point> ch(vector<point> &ps) {
  if (ps.size() == 1) {
    adjust(ps);
    return ps;
  }
  vector<point> lft, rit;
  int sz = ps.size();
  for (int i = 0; i < sz; i++) {
    if (i < sz / 2) {
      lft.push_back(ps[i]);
    } else {
      rit.push_back(ps[i]);
    }
  }
  vector<point> lft_ch = ch(lft), rit_ch = ch(rit);
  return merge(lft_ch, rit_ch);
}
int kmp_res[siz * 6];
bool kmp(vector<long long> &pat, vector<long long> &data) {
  vector<long long> full;
  for (auto v : pat) {
    full.push_back(v);
  }
  full.push_back(LLONG_MAX);
  for (auto v : data) {
    full.push_back(v);
  }
  int sz = full.size(), to_reach = pat.size();
  kmp_res[0] = 0;
  for (int i = 1; i < sz; i++) {
    int j = i - 1;
    while (j >= 0 && full[kmp_res[j]] != full[i]) {
      j = kmp_res[j] - 1;
    }
    kmp_res[i] = j >= 0 ? kmp_res[j] + 1 : 0;
    if (kmp_res[i] == to_reach) {
      return true;
    }
  }
  return false;
}
int n, m;
vector<point> n_p, m_p;
long long sqr_dis(point &a, point &b) {
  return mul(a.x - b.x, a.x - b.x) + mul(a.y - b.y, a.y - b.y);
}
vector<long long> hull_to_chain(vector<point> &h) {
  vector<long long> ret;
  int sz = h.size();
  for (int i = 0; i < sz; i++) {
    int nxt_1 = nxt(i, sz), nxt_2 = nxt(nxt(i, sz), sz);
    ret.push_back(sqr_dis(h[i], h[nxt_1]));
    ret.push_back(dot(h[i], h[nxt_1], h[nxt_2]));
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    n_p.push_back({x, y, i});
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    m_p.push_back({x, y, i});
  }
  sort(n_p.begin(), n_p.end(), cmp);
  sort(m_p.begin(), m_p.end(), cmp);
  vector<point> n_h = ch(n_p), m_h = ch(m_p);
  int n_sz = n_h.size(), m_sz = m_h.size();
  if (min(n_sz, m_sz) == 2) {
    printf("%s\n",
           (n_sz == m_sz && sqr_dis(n_h[0], n_h[1]) == sqr_dis(m_h[0], m_h[1])
                ? "YES"
                : "NO"));
  } else {
    vector<long long> m_chain = hull_to_chain(m_h),
                      n_chain = hull_to_chain(n_h);
    int n_chain_sz = n_chain.size();
    for (int i = 0; i < n_chain_sz - 1; i++) {
      n_chain.push_back(n_chain[i]);
    }
    printf("%s\n", (kmp(m_chain, n_chain) ? "YES" : "NO"));
  }
  return 0;
}
