#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
  int cha, num;
} a[100005];
struct node_cha {
  int val, num;
  int ans;
} cha[100005];
int cmp1(node_cha x, node_cha y) {
  if (x.val == y.val) {
    return x.num < y.num;
  }
  return x.val < y.val;
}
int cmp(node x, node y) {
  if (x.cha == y.cha) {
    return x.x < y.x;
  }
  return x.cha < y.cha;
}
int cmp2(node_cha x, node_cha y) { return x.num < y.num; }
int cmp3(node x, node y) { return x.num < y.num; }
int main() {
  int n, u, v;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d%d", &u, &v);
      a[i].x = u;
      a[i].y = v;
      a[i].num = i;
      a[i].cha = v - u;
    }
    for (int i = 1; i <= n; i++) {
      scanf("%d", &cha[i].val);
      cha[i].num = i;
    }
    sort(a + 1, a + 1 + n, cmp);
    sort(cha + 1, cha + 1 + n, cmp1);
    for (int i = 1; i <= n; i++) {
      cha[i].ans = a[i].num;
    }
    sort(cha + 1, cha + 1 + n, cmp2);
    sort(a + 1, a + 1 + n, cmp3);
    int flag = 0;
    int xpre = -100000;
    int ypre = -100000;
    int x, y;
    for (int i = 1; i <= n; i++) {
      x = a[cha[i].ans].x;
      y = a[cha[i].ans].y;
      if (y - x != cha[i].val) flag = 1;
      if (x <= xpre && y <= ypre) {
        flag = 1;
        xpre = x;
        ypre = y;
        continue;
      } else {
        xpre = x;
        ypre = y;
      }
    }
    if (flag)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int i = 1; i <= n; i++) {
        x = a[cha[i].ans].x;
        y = a[cha[i].ans].y;
        printf("%d %d\n", x, y);
      }
    }
  }
}
