#include <bits/stdc++.h>

using namespace std;

void center(vector<pair<int, int>>& points) {
  int n = points.size();
  pair<int, int> center(0, 0);
  for (int i = 0; i < n; ++i) {
    center.first += points[i].first;
    center.second += points[i].second;
    points[i].first *= n;
    points[i].second *= n;
  }
  for (int i = 0; i < n; ++i) {
    points[i].first -= center.first;
    points[i].second -= center.second;
  }
}

int get_zero_ind(const vector<pair<int, int>>& points) {
  int n = points.size();
  for (int i = 0; i < n; ++i) {
    if ((points[i].first == 0) && (points[i].second == 0)) {
      return i;
    }
  }
  return -1;
}

vector<pair<int, int>> remove_point(const vector<pair<int, int>>& points, int ind) {
  vector<pair<int, int>> result;
  for (int i = 0; i < int(points.size()); ++i) {
    if (i != ind) {
      result.push_back(points[i]);
    }
  }
  return result;
}

vector<int> get_order(const vector<pair<int, int>>& points) {
  const pair<int, int> origin(0, 0);
  int n = points.size();
  vector<int> order(n);
  iota(order.begin(), order.end(), 0);
  sort(order.begin(), order.end(), [&points, &origin](int i1, int i2) {
      bool ba = points[i1] < origin;
      bool bb = points[i2] < origin;
      if (ba != bb) {
	return (ba < bb);
      }
      int cross = points[i1].first * points[i2].second - points[i2].first * points[i1].second;
      if (cross == 0) {
	auto point_length = [](const pair<int, int>& p) {
	  return p.first * p.first + p.second * p.second;
	};
	return point_length(points[i1]) < point_length(points[i2]);
      }
      return (cross > 0);
    });
  return order;
}

vector<array<int, 3>> make_features(const vector<pair<int, int>>& points, const vector<int>& order) {
  int n = order.size();
  vector<array<int, 3>> features(n);
  for (int i = 0; i < n; ++i) {
    const pair<int, int>& me = points[order[i]];
    const pair<int, int>& he = points[order[(i+1)%n]];
    features[i][0] = me.first * me.first + me.second * me.second;
    features[i][1] = me.first * he.first + me.second * he.second;
    features[i][2] = me.first * he.second - me.second * he.first;
  }
  return features;
}

bool can(vector<pair<int, int>>& S, vector<pair<int, int>>& T) {
  int n = S.size();
  center(S);
  center(T);
  int zero_S = get_zero_ind(S);
  int zero_T = get_zero_ind(T);
  if ((zero_S >= 0) != (zero_T >= 0)) {
    return false;
  }
  if (zero_S >= 0) {
    remove_point(S, zero_S).swap(S);
    remove_point(T, zero_T).swap(T);
  }
  n = S.size();
  if (n < 2) {
    return true;
  }
  vector<int> order_S = get_order(S);
  vector<int> order_T = get_order(T);
  vector<array<int, 3>> features_S = make_features(S, order_S);
  vector<array<int, 3>> features_T = make_features(T, order_T);
  for (int i = 0; i < n; ++i) {
    bool ok = true;
    for (int j = 0; ok && (j < n); ++j) {
      ok = (features_S[j] == features_T[(j+i)%n]);
    }
    if (ok) {
      return true;
    }
  }
  return false;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  vector<pair<int, int>> S(N), T(N);
  for (int i = 0; i < N; ++i) {
    cin >> S[i].first >> S[i].second;
  }
  for (int i = 0; i < N; ++i) {
    cin >> T[i].first >> T[i].second;
  }
  cout << (can(S, T) ? "Yes" : "No") << endl;
}

#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int n, m;   
    cin >> n >> m;
    vector<int> a(m), b(m);
    for(int i = 0; i < m; i++) cin >> a[i] >> b[i];
    int k, ans = 0;
    cin >> k;
    vector<int> c(k), d(k);
    for(int i = 0; i < k; i++) cin >> c[i] >> d[i];

    int k2 = 1 << k;
    for(int i = 0; i < k2; i++) {
        vector<int> dish(n+1);
        for(int j = 0; j < k; j++) {
            if((i>>j) & 1) { //iのj桁目が1なら
                dish[d[j]]++;
            } else {
                dish[c[j]]++;
            }
        }
        int now = 0;
        for(int j = 0; j < m; j++) {
            if(dish[a[j]] == 0) continue;
            if(dish[b[j]] == 0) continue;
            now++;
        }
        ans = max(ans, now);
    }
    cout << ans << endl;
    return 0;
}