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