#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, id, val, rec;
} s[100010], w[100010];
bool cmp(node a, node b) {
  if (a.val != b.val) {
    return a.val < b.val;
  } else if (a.x != b.x) {
    return a.x < b.x;
  } else
    return a.y < b.y;
}
bool cmp1(node a, node b) {
  if (a.val != b.val)
    return a.val < b.val;
  else
    return a.id < b.id;
}
bool cmp2(node a, node b) { return a.id < b.id; }
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &s[i].x, &s[i].y);
      s[i].val = s[i].y - s[i].x;
      s[i].id = i;
    }
    for (int i = 0; i < n; i++) {
      scanf("%d", &w[i].val);
      w[i].id = i;
    }
    sort(s, s + n, cmp);
    sort(w, w + n, cmp1);
    int flag = 1;
    for (int i = 0; i < n; i++) {
      if (s[i].val == w[i].val) {
        w[i].rec = s[i].id;
      } else {
        flag = 0;
      }
    }
    if (flag) {
      sort(s, s + n, cmp2);
      sort(w, w + n, cmp2);
      for (int i = 1; i < n; i++) {
        if (!(s[w[i].rec].x > s[w[i - 1].rec].x ||
              s[w[i].rec].y > s[w[i - 1].rec].y)) {
          flag = 0;
          break;
        }
      }
      if (flag) {
        printf("YES\n");
        for (int i = 0; i < n; i++) {
          printf("%d %d\n", s[w[i].rec].x, s[w[i].rec].y);
        }
      }
    }
    if (!flag) {
      printf("NO\n");
    }
  }
  return 0;
}
