#include <bits/stdc++.h>
using namespace std;
int static const N = 200010;
struct tac {
  int x, y, plea;
};
bool cmp(tac a, tac b) {
  if (a.x < b.x) return true;
  if (a.x == b.x && a.y < b.y) return true;
  return false;
}
struct prst {
  int poz, delta;
};
bool comp(prst a, prst b) {
  if (a.delta < b.delta) return true;
  if (a.delta == b.delta && a.poz < b.poz) return true;
  return false;
}
tac a[N];
prst b[N];
int n, w[N], pov[N];
bool used[N];
int gaja[N], paja[N];
int radi() {
  sort(gaja, gaja + n);
  sort(paja, paja + n);
  for (int i = 0; i < n; i++)
    if (gaja[i] != paja[i]) return 0;
  return 1;
}
vector<int> v[N];
int sredi() {
  for (int i = 0; i < n; i++) {
    int j = i, br = 0;
    while (j < n && a[j].x == a[i].x) {
      v[a[i].x].push_back(a[j].plea);
      if (a[i].x > 0 && v[a[i].x - 1][br] > a[j].plea) return 0;
      if (br > 0 && v[a[i].x][br - 1] > a[j].plea) return 0;
      j++;
    }
    i = j - 1;
  }
  return 1;
}
int main() {
  scanf("%i", &n);
  for (int i = 0; i < n; i++) {
    scanf("%i%i", &a[i].x, &a[i].y);
    gaja[i] = a[i].y - a[i].x;
  }
  for (int i = 0; i < n; i++) {
    scanf("%i", &w[i]);
    paja[i] = w[i];
  }
  if (radi() == 0) {
    printf("NO\n");
    return 0;
  }
  sort(a, a + n, cmp);
  for (int i = 0; i < n; i++) {
    b[i].delta = a[i].y - a[i].x;
    b[i].poz = i;
  }
  sort(b, b + n, comp);
  for (int i = n - 1; i >= 0; i--) {
    int l = 0, d = n - 1, ll, dd;
    while (b[l].delta < w[i]) {
      if (d - l == 1) {
        l++;
        break;
      }
      int m = (l + d) / 2;
      if (b[m].delta < w[i])
        l = m;
      else
        d = m;
    }
    ll = l;
    l = 0;
    d = n - 1;
    while (b[d].delta > w[i]) {
      if (d - l == 1) {
        d--;
        break;
      }
      int m = (l + d) / 2;
      if (b[m].delta <= w[i])
        l = m;
      else
        d = m;
    }
    dd = d;
    while (used[dd] == true) {
      if (dd - ll == 1) {
        dd--;
        break;
      }
      int m = (ll + dd) / 2;
      if (used[m] == true)
        dd = m;
      else
        ll = m;
    }
    used[dd] = true;
    a[b[dd].poz].plea = i;
    pov[i] = b[dd].poz;
  }
  if (sredi()) {
    printf("YES\n");
    for (int i = 0; i < n; i++) printf("%i %i\n", a[pov[i]].x, a[pov[i]].y);
  } else
    printf("NO\n");
  return 0;
}
