#include <bits/stdc++.h>
using namespace std;
int x[100500];
int y[100500];
pair<int, int> a[100500];
int w[100500];
set<pair<int, int>> eq[200500];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
    eq[y[i] - x[i] + 100000].emplace(x[i], y[i]);
  }
  for (int i = 0; i < n; ++i) {
    cin >> w[i];
    if (eq[w[i] + 100000].empty()) {
      cout << "NO\n";
      return 0;
    }
    auto it = eq[w[i] + 100000].begin();
    a[i] = *it;
    eq[w[i] + 100000].erase(it);
  }
  auto p = [](const pair<int, int>& p1, const pair<int, int>& p2) {
    return (p1.first <= p2.first && p1.second <= p2.second);
  };
  if (!is_sorted(a, a + n, p)) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    cout << a[i].first << ' ' << a[i].second << '\n';
  }
}
