#include <bits/stdc++.h>
using namespace std;
map<int, int>::iterator it;
map<int, int> ma1[100005], ma2[100005];
int c1[100005 * 2], c2[100005 * 2];
int ans1[100005], ans2[100005];
int x[100005], y[100005], w[100005];
int nowx[100005 * 2];
int n;
void doit() {
  memset(c1, 0, sizeof(c1));
  memset(c2, 0, sizeof(c2));
  int xma = 0, yma = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    c1[y[i] - x[i] + 100000]++;
    xma = max(xma, x[i]);
    yma = max(yma, y[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
    c2[w[i] + 100000]++;
  }
  for (int i = 0; i <= 200000; i++)
    if (c1[i] != c2[i]) {
      puts("NO");
      return;
    }
  for (int i = 0; i <= 100000; i++) nowx[i + 100000] = 0;
  for (int i = -100000; i <= -1; i++) nowx[i + 100000] = -i;
  for (int i = 0; i <= xma; i++) ma1[i].clear();
  for (int i = 0; i <= yma; i++) ma2[i].clear();
  int nx, ny;
  for (int i = 1; i <= n; i++) {
    nx = nowx[w[i] + 100000];
    nowx[w[i] + 100000]++;
    ny = nx + w[i];
    ans1[i] = nx;
    ans2[i] = ny;
    ma1[nx][ny] = i;
    ma2[ny][nx] = i;
  }
  for (int i = 0; i <= xma; i++) {
    int last = 0;
    for (it = ma1[i].begin(); it != ma1[i].end(); ++it) {
      if (last > it->second) {
        puts("NO");
        return;
      }
      last = it->second;
    }
  }
  for (int i = 0; i <= yma; i++) {
    int last = 0;
    for (it = ma2[i].begin(); it != ma2[i].end(); ++it) {
      if (last > it->second) {
        puts("NO");
        return;
      }
      last = it->second;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d %d\n", ans1[i], ans2[i]);
}
int main() {
  while (scanf("%d", &n) != EOF) {
    doit();
  }
}
