#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x[200000], y[200000], w, o[200000];
  pair<int, int> curx = make_pair(-200000, -200000),
                 cury = make_pair(-200000, -200000);
  map<int, set<pair<int, int> > > a;
  vector<pair<int, int> > ans;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    a[y[i] - x[i]].insert(make_pair(x[i] + y[i], i));
  }
  for (int j = 0; j < n; j++) {
    scanf("%d", &w);
    bool o = false;
    if (a[w].size() == 0) {
      cout << "NO";
      return 0;
    }
    set<pair<int, int> >::iterator it = a[w].begin();
    pair<int, int> h = *it;
    if (x[h.second] <= curx.first && y[h.second] <= curx.second) {
      cout << "NO";
      return 0;
    }
    if (x[h.second] <= cury.first && y[h.second] <= cury.second) {
      cout << "NO";
      return 0;
    }
    ans.push_back(make_pair(x[h.second], y[h.second]));
    if (curx.first < x[h.second]) {
      curx.first = x[h.second];
      curx.second = y[h.second];
    }
    if (cury.second < y[h.second]) {
      cury.first = x[h.second];
      cury.second = y[h.second];
    }
    a[w].erase(h);
  }
  cout << "YES\n";
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
