#include <bits/stdc++.h>
using namespace std;
int n, w[100100], cur, t, v[100100];
bool ok;
set<pair<int, int> > y;
set<pair<int, int> >::iterator it;
pair<int, pair<int, int> > x[100100];
pair<int, int> ans[100100];
int main() {
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d\n", &x[i].second.first, &x[i].second.second);
    x[i].first = x[i].second.first + x[i].second.second;
  }
  sort(x, x + n);
  for (int i = 0; i < n; i++) {
    scanf("%d ", &w[i]);
    y.insert(make_pair(w[i], i));
  }
  for (int i = 0; i < n; i++) {
    cur = x[i].second.second - x[i].second.first;
    t = -1;
    for (int j = max(i - 400, 0); j < i; j++)
      if (x[i].second.first >= x[j].second.first &&
          x[i].second.second >= x[j].second.second)
        t = max(t, v[j]);
    it = y.lower_bound(make_pair(cur, t));
    if (it == y.end() || (it->first != cur)) {
      ok = 1;
      break;
    }
    v[i] = it->second;
    ans[it->second].first = x[i].second.first;
    ans[it->second].second = x[i].second.second;
    y.erase(it);
  }
  if (ok)
    printf("NO");
  else {
    printf("YES\n");
    for (int i = 0; i < n; i++) printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
