#include <bits/stdc++.h>
using namespace std;
struct pt {
  int x, y, w, idx;
};
bool cmp1(const pt &a, const pt &b) {
  return a.y - a.x < b.y - b.x || a.y - a.x == b.y - b.x && a.y < b.y;
}
bool cmp2(const pt &a, const pt &b) {
  return a.w < b.w || a.w == b.w && a.idx < b.idx;
}
bool cmp3(const pt &a, const pt &b) { return a.idx < b.idx; }
int main() {
  int n;
  cin >> n;
  vector<pt> pts(n), ws(n);
  for (int i = 0; i < n; ++i)
    cin >> pts[i].x >> pts[i].y, pts[i].w = pts[i].y - pts[i].x, pts[i].idx = i;
  sort(pts.begin(), pts.end(), &cmp1);
  for (int i = 0; i < n; ++i) cin >> ws[i].w, ws[i].idx = i;
  sort(ws.begin(), ws.end(), &cmp2);
  for (int i = 0; i < n; ++i)
    if (ws[i].w != pts[i].w) {
      cout << "NO\n";
      return 0;
    }
  for (int i = 0; i < n; ++i) {
    ws[i].x = pts[i].x;
    ws[i].y = pts[i].y;
  }
  sort(ws.begin(), ws.end(), &cmp3);
  for (int i = 1; i < n; ++i)
    if (ws[i].x <= ws[i - 1].x && ws[i].y <= ws[i - 1].y) {
      cout << "NO\n";
      return 0;
    }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << ws[i].x << ' ' << ws[i].y << endl;
  return 0;
}
