#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
const int SHIFT = 2e5;
set<pair<int, int> > s[maxn];
int m[100007];
int main() {
  int n;
  cin >> n;
  int x, y;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    s[y - x + SHIFT].insert(make_pair(x, y));
  }
  for (int i = 0; i < n; ++i) {
    cin >> m[i];
    m[i] += SHIFT;
  }
  int ok = 1;
  pair<int, int> now;
  now.first = now.second = -1e9 - 7;
  vector<pair<int, int> > ans;
  for (int i = 0; i < n; ++i) {
    if (s[m[i]].empty()) {
      ok = 0;
      break;
    }
    pair<int, int> x = *s[m[i]].begin();
    s[m[i]].erase(x);
    ans.push_back(x);
    if (x.first <= now.first && x.second <= now.second) {
      ok = 0;
      break;
    }
    now = max(now, x);
  }
  if (ok) {
    puts("YES");
    for (int i = 0; i < n; ++i) printf("%d %d\n", ans[i].first, ans[i].second);
  } else
    puts("NO");
}
