#include <bits/stdc++.h>
using namespace std;
struct Node {
  int x, y, val, id, rec;
};
Node num1[(200000 + 10)], num2[(200000 + 10)];
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;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num1[i].x);
    scanf("%d", &num1[i].y);
    num1[i].val = num1[i].y - num1[i].x;
    num1[i].id = i;
  }
  sort(num1, num1 + n, cmp);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num2[i].val);
    num2[i].id = i;
  }
  sort(num2, num2 + n, cmp1);
  bool flag = true;
  for (int i = 0; i < n; i++) {
    if (num1[i].val != num2[i].val) {
      flag = false;
      break;
    } else
      num2[i].rec = num1[i].id;
  }
  if (flag) {
    sort(num2, num2 + n, cmp2);
    sort(num1, num1 + n, cmp2);
    for (int i = 1; i < n; i++) {
      if (!(num1[num2[i].rec].x > num1[num2[i - 1].rec].x ||
            num1[num2[i].rec].y > num1[num2[i - 1].rec].y)) {
        flag = false;
        break;
      }
    }
    if (flag) {
      printf("YES\n");
      for (int i = 0; i < n; i++)
        printf("%d %d\n", num1[num2[i].rec].x, num1[num2[i].rec].y);
    } else
      printf("NO\n");
  } else
    printf("NO\n");
  return 0;
}
