#include <bits/stdc++.h>
using namespace std;
template <typename T>
using maxHeap = priority_queue<T, vector<T>, less<T>>;
template <typename T>
using minHeap = priority_queue<T, vector<T>, greater<T>>;
template <typename Iter>
ostream& _out(ostream& s, Iter b, Iter e) {
  s << "[";
  for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
  s << "]";
  return s;
}
template <typename A, typename B>
ostream& operator<<(ostream& s, const pair<A, B>& p) {
  return s << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& c) {
  return _out(s, begin(c), end(c));
}
bool debug = 0;
template <typename T>
void DEBUG(const T& x) {
  if (debug) cerr << x;
}
template <typename T, typename... Args>
void DEBUG(const T& head, const Args&... tail) {
  if (debug) {
    cerr << head;
    DEBUG(tail...);
  }
}
template <typename T>
struct Point {
  static constexpr long double EPS = 1e-8;
  T x, y;
  Point(T _ = 0, T __ = 0) : x(_), y(__) {}
  template <typename T2>
  Point(const Point<T2>& a) : x(a.x), y(a.y) {}
  inline long double theta() const {
    return atan2((long double)y, (long double)x);
  }
  inline long double dis() const {
    return hypot((long double)x, (long double)y);
  }
  inline long double dis(const Point& o) const {
    return hypot((long double)(x - o.x), (long double)(y - o.y));
  }
  Point operator-(const Point& o) const { return Point(x - o.x, y - o.y); }
  Point operator-=(const Point& o) {
    x -= o.x, y -= o.y;
    return *this;
  }
  Point operator+(const Point& o) const { return Point(x + o.x, y + o.y); }
  Point operator+=(const Point& o) {
    x += o.x, y += o.y;
    return *this;
  }
  Point operator*(const T& k) const { return Point(x * k, y * k); }
  Point operator*=(const T& k) {
    x *= k, y *= k;
    return *this;
  }
  Point operator/(const T& k) const { return Point(x / k, y / k); }
  Point operator/=(const T& k) {
    x /= k, y /= k;
    return *this;
  }
  Point operator-() const { return Point(-x, -y); }
  Point rot90() const { return Point(-y, x); }
  bool equal(const Point& o, true_type) const {
    return fabs(x - o.x) < EPS and fabs(y - o.y) < EPS;
  }
  bool equal(const Point& o, false_type) const {
    return tie(x, y) == tie(o.x, o.y);
  }
  bool operator==(const Point& o) const {
    return equal(o, is_floating_point<T>());
  }
  bool operator!=(const Point& o) const { return !(*this == o); }
  bool operator<(const Point& o) const { return theta() < o.theta(); }
  friend inline T cross(const Point& a, const Point& b) {
    return a.x * b.y - b.x * a.y;
  }
  friend inline T dot(const Point& a, const Point& b) {
    return a.x * b.x + a.y * b.y;
  }
  friend ostream& operator<<(ostream& ss, const Point& o) {
    ss << "(" << o.x << ", " << o.y << ")";
    return ss;
  }
};
template <typename T>
class ConvexHull_2D {
 private:
  vector<Point<T>> dots;
  struct myhash {
    uint64_t operator()(const Point<T>& a) const {
      uint64_t xx = 0, yy = 0;
      memcpy(&xx, &a.x, sizeof(a.x));
      memcpy(&yy, &a.y, sizeof(a.y));
      uint64_t ret = xx * 17 + yy * 31;
      ret = (ret ^ (ret >> 16)) * 0x9E3779B1;
      ret = (ret ^ (ret >> 13)) * 0xC2B2AE35;
      ret = ret ^ xx;
      return (ret ^ (ret << 3)) * yy;
    }
  };
  unordered_set<Point<T>, myhash> in_hull;

 public:
  inline void init() {
    in_hull.clear();
    dots.clear();
  }
  void insert(const Point<T>& x) { dots.push_back(x); }
  void solve() {
    sort(begin(dots), end(dots), [](const Point<T>& a, const Point<T>& b) {
      return tie(a.x, a.y) < tie(b.x, b.y);
    });
    vector<Point<T>> stk((int)((dots).size()) << 1);
    int top = 0;
    for (auto p : dots) {
      while (top >= 2 and
             cross(p - stk[top - 2], stk[top - 1] - stk[top - 2]) <= 0)
        top--;
      stk[top++] = p;
    }
    for (int i = (int)((dots).size()) - 2, t = top + 1; i >= 0; i--) {
      while (top >= t and
             cross(dots[i] - stk[top - 2], stk[top - 1] - stk[top - 2]) <= 0)
        top--;
      stk[top++] = dots[i];
    }
    stk.resize(top - 1);
    swap(stk, dots);
    for (auto i : stk) in_hull.insert(i);
  }
  vector<Point<T>> get() { return dots; }
  inline bool in_it(const Point<T>& x) {
    return in_hull.find(x) != in_hull.end();
  }
};
using PTL = Point<int64_t>;
ConvexHull_2D<int64_t> cv;
template <typename T>
bool check(const vector<T>&, const vector<T>&);
vector<int64_t> get_it(const vector<PTL>& a) {
  vector<int64_t> ret;
  ret.push_back(dot(a.back() - a[0], a.back() - a[0]));
  ret.push_back(dot(a.back() - a[0], a[1] - a[0]));
  for (int i = 1; i < (int)((a).size()) - 1; i++) {
    ret.push_back(dot(a[i - 1] - a[i], a[i - 1] - a[i]));
    ret.push_back(dot(a[i - 1] - a[i], a[i + 1] - a[i]));
  }
  ret.push_back(dot(a[(int)((a).size()) - 2] - a[(int)((a).size()) - 1],
                    a[(int)((a).size()) - 2] - a[(int)((a).size()) - 1]));
  ret.push_back(dot(a[(int)((a).size()) - 2] - a[(int)((a).size()) - 1],
                    a[0] - a[(int)((a).size()) - 1]));
  return ret;
}
int main(int argc, char* argv[]) {
  if (argc > 1 and string(argv[1]) == "-D") debug = 1;
  if (!debug) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
  auto kill = []() {
    cout << "NO" << '\n';
    exit(0);
  };
  int n, m;
  cin >> n >> m;
  cv.init();
  for (int i = 0; i < n; i++) {
    int64_t x, y;
    cin >> x >> y;
    cv.insert(PTL(x, y));
  }
  cv.solve();
  vector<PTL> one = cv.get();
  cv.init();
  for (int i = 0; i < m; i++) {
    int64_t x, y;
    cin >> x >> y;
    cv.insert(PTL(x, y));
  }
  cv.solve();
  vector<PTL> two = cv.get();
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 217 << " - " << ("one") << "="
         << (one) << '\n';
  if (debug)
    cerr << __PRETTY_FUNCTION__ << ":" << 218 << " - " << ("two") << "="
         << (two) << '\n';
  if ((int)((one).size()) != (int)((two).size())) kill();
  if (!check(get_it(one), get_it(two))) kill();
  cout << "YES" << '\n';
  return 0;
}
template <typename T>
bool check(const vector<T>& a, const vector<T>& b) {
  for (int i = 0; i < (int)((a).size()); i++) {
    bool flag = true;
    for (int j = 0; j < (int)((b).size()); j++) {
      flag &= (a[(i + j) % (int)((a).size())] == b[j]);
      if (!flag) break;
    }
    if (flag) return true;
  }
  return false;
}
