#include <bits/stdc++.h>
using namespace std;
struct pp {
  int x, y;
  int m, id;
} p[100010];
struct ww {
  int w, id;
} w[100010];
bool cmp1(pp a, pp b) {
  if (a.m != b.m)
    return a.m < b.m;
  else if (a.m == b.m && a.y != b.y)
    return a.y < b.y;
  else if (a.m == b.m && a.y == b.y)
    return a.x < b.x;
}
bool cmp2(ww a, ww b) {
  if (a.w != b.w)
    return a.w < b.w;
  else if (a.w == b.w)
    return a.id < b.id;
}
bool cmp0(pp a, pp b) { return a.id < b.id; }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].x >> p[i].y;
    p[i].m = p[i].y - p[i].x;
  }
  for (int i = 1; i <= n; i++) {
    cin >> w[i].w;
    w[i].id = i;
  }
  bool flag = true;
  sort(p + 1, p + n + 1, cmp1);
  sort(w + 1, w + n + 1, cmp2);
  bool ff = true;
  for (int i = 1; i <= n; i++) {
    p[i].id = w[i].id;
    if (p[i].m != w[i].w) {
      flag = false;
      break;
    }
  }
  if (flag == false) {
    cout << "NO\n";
    return 0;
  }
  sort(p + 1, p + n + 1, cmp0);
  for (int i = 1; i <= n - 1; i++) {
    if (p[i].x >= p[i + 1].x && p[i].y >= p[i + 1].y) {
      ff = false;
      break;
    }
  }
  if (ff) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      cout << p[i].x << " " << p[i].y << endl;
    }
  } else {
    cout << "NO\n";
  }
  return 0;
}
