#include <bits/stdc++.h>
using namespace std;
int a[100001], b;
struct t {
  int l, r;
} tree;
map<int, map<int, struct t> > m;
map<int, int> k, d, e;
int main() {
  int n, i, ara, l[100001], p[100001];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ara >> b;
    a[i] = b - ara;
    tree.l = ara;
    tree.r = b;
    m[a[i]][k[a[i]]] = tree;
    if (k[a[i]] != 0) {
      if (tree.l < m[a[i]][k[a[i]] - 1].l && tree.r < m[a[i]][k[a[i]] - 1].r) {
        int t1 = m[a[i]][k[a[i]] - 1].l, t2 = m[a[i]][k[a[i]] - 1].r;
        m[a[i]][k[a[i]] - 1].l = tree.l;
        m[a[i]][k[a[i]] - 1].r = tree.r;
        m[a[i]][k[a[i]]].l = t1;
        m[a[i]][k[a[i]]].r = t2;
      }
    }
    k[a[i]]++;
  }
  for (i = 0; i < n; i++) {
    cin >> l[i];
    p[i] = l[i];
  }
  sort(l, l + n);
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    if (a[i] != l[i]) {
      cout << "NO";
      return 0;
    }
  }
  int max1 = 0, max2 = 0;
  for (i = 0; i < n; i++) {
    if (m[p[i]][e[p[i]]].l < max1 && m[p[i]][e[p[i]]].r < max2) {
      cout << "NO";
      return 0;
    } else if (m[p[i]][e[p[i]]].l < max1 && m[p[i]][e[p[i]]].r == max2) {
      cout << "NO";
      return 0;
    } else if (m[p[i]][e[p[i]]].l == max1 && m[p[i]][e[p[i]]].r < max2) {
      cout << "NO";
      return 0;
    }
    if (m[p[i]][e[p[i]]].l >= max1 && m[p[i]][e[p[i]]].r >= max2) {
      max1 = m[p[i]][e[p[i]]].l;
      max2 = m[p[i]][e[p[i]]].r;
    }
    e[p[i]]++;
  }
  cout << "YES" << endl;
  for (i = 0; i < n; i++) {
    cout << m[p[i]][d[p[i]]].l << " " << m[p[i]][d[p[i]]].r << endl;
    d[p[i]]++;
  }
  return 0;
}
