#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3F3F3F3F;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
int N, M;
pair<int, int> pts1[MAX], pts2[MAX];
stack<pair<int, int> > h1, h2;
vector<double> hull1, hull2;
int lps[2 * MAX];
inline long long int orientation(pair<int, int> a, pair<int, int> b,
                                 pair<int, int> c) {
  return (long long int)(b.second - a.second) * (c.first - b.first) -
         (long long int)(c.second - b.second) * (b.first - a.first);
}
inline double dist(pair<int, int> p1, pair<int, int> p2) {
  long long int x = p1.first - p2.first, y = p1.second - p2.second;
  return sqrt(x * x + y * y);
}
inline double angle(pair<int, int> p1, pair<int, int> p2, pair<int, int> p3) {
  long long int x1 = p1.first - p2.first, y1 = p1.second - p2.second;
  long long int x2 = p3.first - p2.first, y2 = p3.second - p2.second;
  long long int dot = x1 * x2 + y1 * y2, det = x1 * y2 - y1 * x2;
  double d1 = dist(p1, p2), d2 = dist(p2, p3);
  return atan2(det, dot) * (d1 / d2);
}
inline void popStack(stack<pair<int, int> > &st,
                     vector<pair<int, int> > &hull) {
  while (st.size() > 1) {
    hull.push_back({st.top().first, st.top().second});
    st.pop();
  }
}
void process(pair<int, int> p, stack<pair<int, int> > &st) {
  bool cw = false;
  while (st.size() > 1 && !cw) {
    pair<int, int> b = st.top();
    st.pop();
    pair<int, int> a = st.top();
    if (orientation(a, b, p) > 0) {
      cw = true;
      st.push(b);
    }
  }
  st.push(p);
}
void findHull(int N, pair<int, int> arr[], vector<double> &hull) {
  vector<pair<int, int> > v;
  while (!h1.empty()) {
    h1.pop();
  }
  while (!h2.empty()) {
    h2.pop();
  }
  sort(arr, arr + N);
  for (int i = 0; i < N; i++) {
    process(arr[i], h1);
  }
  for (int i = N - 1; i >= 0; i--) {
    process(arr[i], h2);
  }
  popStack(h1, v);
  popStack(h2, v);
  for (int i = 0; i < v.size(); i++) {
    pair<int, int> p1 = v[i], p2 = v[(i + 1) % v.size()],
                   p3 = v[(i + 2) % v.size()];
    hull.push_back(dist(p1, p2));
    hull.push_back(angle(p1, p2, p3));
  }
}
bool kmp(vector<double> &T, vector<double> &S) {
  int N = (int)S.size(), M = (int)T.size();
  int len = 0;
  lps[0] = 0;
  int i = 1, j = 0;
  while (i < M) {
    if (abs(T[i] - T[len]) < 1e-9) {
      len++;
      lps[i] = len;
      i++;
    } else {
      if (len != 0) {
        len = lps[len - 1];
      } else {
        lps[i] = 0;
        i++;
      }
    }
  }
  i = 0, j = 0;
  while (i < N) {
    if (abs(T[j] - S[i]) < 1e-9) {
      j++, i++;
    }
    if (j == M) {
      return 1;
    } else if (i < N && abs(T[j] - S[i]) > 1e-9) {
      if (j != 0) {
        j = lps[j - 1];
      } else {
        i++;
      }
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &pts1[i].first, &pts1[i].second);
  }
  for (int i = 0; i < M; i++) {
    scanf("%d%d", &pts2[i].first, &pts2[i].second);
  }
  findHull(N, pts1, hull1);
  findHull(M, pts2, hull2);
  if (hull1.size() != hull2.size()) {
    printf("NO\n");
  } else {
    int n = (int)hull1.size();
    for (int i = 0; i < n; i++) {
      hull1.push_back(hull1[i]);
    }
    printf(kmp(hull2, hull1) ? "YES\n" : "NO\n");
  }
  return 0;
}
