#include <bits/stdc++.h>
using namespace std;
void imp() {
  cout << "NO\n";
  exit(0);
}
int n;
pair<int, int> pt[100005];
int w[100005];
vector<int> _Vpt[200005], _Vw[200005];
vector<int>*Vpt = _Vpt + 100002, *Vw = _Vw + 100002;
int sol[100005];
pair<int, int> sol2[100005];
int ind[100005];
map<pair<int, int>, int> MM;
int& M(pair<int, int> t) {
  if (!MM.count(t)) MM[t] = 1000000000;
  return MM[t];
}
int min(int a, int b, int c) { return min(min(a, b), c); }
int main() {
  cin >> n;
  for (int i = (int)(0); i < (int)(n); ++i)
    scanf("%d%d", &pt[i].first, &pt[i].second);
  for (int i = (int)(0); i < (int)(n); ++i) scanf("%d", w + i);
  for (int i = (int)(0); i < (int)(n); ++i)
    Vpt[pt[i].second - pt[i].first].push_back(i);
  for (int i = (int)(0); i < (int)(n); ++i) Vw[w[i]].push_back(i);
  for (int i = (int)(-100001); i < (int)(100001); ++i)
    if (Vpt[i].size() != Vw[i].size()) imp();
  for (int i = (int)(-100001); i < (int)(100001); ++i) {
    sort((Vpt[i]).begin(), (Vpt[i]).end(),
         [&](int a, int b) { return pt[a] < pt[b]; });
    sort((Vw[i]).begin(), (Vw[i]).end());
    for (int j = (int)(0); j < (int)(Vpt[i].size()); ++j)
      sol[Vpt[i][j]] = Vw[i][j];
  }
  for (int i = (int)(0); i < (int)(n); ++i) sol2[sol[i]] = pt[i], ind[i] = i;
  sort(ind, ind + n, [&](int a, int b) {
    if (pt[a].first != pt[b].first) return pt[a].first > pt[b].first;
    return pt[a].second > pt[b].second;
  });
  for (int i = (int)(0); i < (int)(n); ++i) {
    int id = ind[i];
    int v = sol[id];
    pair<int, int> t = pt[id];
    M(t) = min(v, M({t.first, t.second + 1}), M({t.first + 1, t.second}));
    if (M(t) < v) imp();
  }
  cout << "YES\n";
  for (int i = (int)(0); i < (int)(n); ++i)
    printf("%d %d\n", sol2[i].first, sol2[i].second);
  cout << endl;
  return 0;
}
