#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, MOD = 1e9 + 7, MAXN = 1e5 + 10;
const long long inf = 1e10 + 10;
long long x[N], y[N], w[N];
multiset<pair<int, pair<int, int> > > s, su;
multiset<pair<int, int> > s1;
multiset<pair<int, int> >::iterator io;
multiset<pair<int, pair<int, int> > >::iterator it, ik;
vector<pair<int, int> > v;
bool check(int a, int b) {
  io = s1.upper_bound(make_pair(a, b));
  if (io != s1.end()) {
    if ((*io).first == a && (*io).second > b) {
      return 1;
    }
    if ((*io).second == b && (*io).first > a) {
      return 1;
    }
    if ((*io).first > a && (*io).second > b) {
      return 1;
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    s.insert(make_pair(y[i] - x[i], make_pair(x[i], y[i])));
    su.insert(make_pair(y[i] - x[i], make_pair(y[i], x[i])));
  }
  for (int i = 0; i < n; i++) {
    cin >> w[i];
  }
  for (int i = 0; i < n; i++) {
    it = s.lower_bound(make_pair(w[i], make_pair(-1, -1)));
    ik = su.lower_bound(make_pair(w[i], make_pair(-1, -1)));
    if (it == s.end() && ik == su.end()) {
      cout << "NO" << endl;
      return 0;
    }
    if ((*it).first != w[i] && (*ik).first != w[i]) {
      cout << "NO" << endl;
      return 0;
    }
    if (check((*it).second.first, (*it).second.second) == 1 &&
        check((*ik).second.second, (*ik).second.first) == 1) {
      cout << "NO" << endl;
      return 0;
    }
    if (check((*it).second.first, (*it).second.second) == 0 &&
        (*it).first == w[i]) {
      v.push_back(make_pair((*it).second.first, (*it).second.second));
      s1.insert(make_pair((*it).second.first, (*it).second.second));
      su.erase(
          make_pair(w[i], make_pair((*it).second.second, (*it).second.first)));
      s.erase(it);
    } else if ((*ik).first == w[i]) {
      v.push_back(make_pair((*ik).second.second, (*ik).second.first));
      s1.insert(make_pair((*ik).second.second, (*ik).second.first));
      su.erase(ik);
      s.erase(make_pair((*ik).first,
                        make_pair((*ik).second.second, (*ik).second.first)));
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < (int)v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
