#include <bits/stdc++.h>
using Int = long long;  // clang-format off
using pii = std::pair<Int, Int>;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define RREP_(i, a_, b_, a, b, ...) for (Int i = Int(b) - 1, low##i = (a); i >= low##i; i--)
#define RREP(i, ...) RREP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) std::begin(v), std::end(v)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on
struct in {
    template <class T> operator T() {
        T t;
        std::cin >> t;
        return t;
    }
};
void out() { std::cout << "\n"; }
template <class Head, class... Tail> void out(Head&& h, Tail&&... t) {
    std::cout << h << (sizeof...(Tail) == 0 ? "" : " "), out(std::forward<Tail>(t)...);
}
template <class T> bool chmin(T& a, const T& b) { return a > b ? a = b, true : false; }
template <class T> bool chmax(T& a, const T& b) { return a < b ? a = b, true : false; }
template <class T> using V = std::vector<T>;

/**
 *    author:  knshnb
 *    created: Sun Jun 27 14:56:28 JST 2021
 **/

using comp = std::complex<double>;
double EPS = 1e-8;
bool equal(double a, double b) { return std::abs(a - b) < EPS; }
bool equal(comp a, comp b) { return std::abs(a - b) < EPS; }
bool set_equal(V<comp> a, V<comp> b) {
    for (comp x : a) {
        bool del = false;
        for (comp y : b) {
            if (equal(x, y)) {
                del = true;
                b.erase(std::find(ALL(b), y));
                break;
            }
        }
        if (!del) return false;
    }
    return true;
}
bool check(V<comp> a, V<comp> b, Int i, Int j) {
    Int n = a.size();
    comp dif1 = a[0], dif2 = b[i];
    REP(k, n) a[k] -= dif1, b[k] -= dif2;
    if (!equal(std::abs(a[1]), std::abs(b[j]))) return false;
    comp arg = a[1] / b[j];
    assert(equal(std::abs(arg), 1.));
    REP(k, n) b[k] *= arg;
    return set_equal(a, b);
}
signed main() {
    Int n = in();
    V<comp> s(n), t(n);
    REP(i, n) s[i].real(in()), s[i].imag(in());
    REP(i, n) t[i].real(in()), t[i].imag(in());
    if (n == 1) {
        out("Yes");
        return 0;
    }
    REP(i, n) {
        REP(j, n) {
            if (i == j) continue;
            if (check(s, t, i, j)) {
                out("Yes");
                return 0;
            }
        }
    }
    out("No");
}

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

using I64 = int64_t;

template <typename T> T gcd(T x, T y) {
  if (y == 0) {
    return x;
  } else {
    return gcd(y, x % y);
  }
}

template <typename T> T lcm(T x, T y) { return x / gcd(x, y) * y; }

const char NL = '\n';

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> va(N), vb(M);
  for (auto &a : va) {
    cin >> a;
  }
  for (auto &b : vb) {
    cin >> b;
  }

  sort(va.begin(), va.end());
  sort(vb.begin(), vb.end());

  auto ia = va.begin();
  auto ib = vb.begin();
  vector<int> ans;
  for (; ia != va.end() || ib != vb.end();) {
    if (ia == va.end()) {
      ans.push_back(*ib);
      ib++;
    } else if (ib == vb.end()) {
      ans.push_back(*ia);
      ia++;
    } else if (*ia > *ib) {
      ans.push_back(*ib);
      ib++;
    } else if (*ia < *ib) {
      ans.push_back(*ia);
      ia++;
    } else {
      ia++;
      ib++;
    }
  }

  bool blank = false;
  for (auto x : ans) {
    if (blank) {
      cout << ' ';
    }
    cout << x;
    blank = true;
  }
  cout << NL;
}
