#include <bits/stdc++.h>
using namespace std;
map<int, int> _index;
map<int, int> _index2;
vector<pair<int, int> > todos[100010];
map<pair<int, int>, bool> used;
int n;
int cont;
bool com(pair<int, int> A, pair<int, int> B) {
  if (A.first <= B.first && A.second <= B.second) return true;
  return false;
}
pair<int, int> get_ant(pair<int, int> p) {
  if (p.first != 0 && p.second != 0)
    return make_pair(p.first - 1, p.second - 1);
  else if (p.first == 0)
    return make_pair(p.first, p.second - 1);
  else
    return make_pair(p.first - 1, p.second);
}
int main() {
  cin >> n;
  int x, y, xx, yy;
  cont = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    int ind = y - x;
    if (!_index.count(ind)) _index[ind] = cont++;
    todos[_index[ind]].push_back(make_pair(x, y));
  }
  for (int i = 0; i < cont; i++)
    sort((todos[i]).begin(), (todos[i]).end(), com);
  vector<pair<int, int> > res;
  int w;
  bool pode = true;
  pair<int, int> p;
  int n_ind;
  for (int i = 0; i < n; i++) {
    cin >> w;
    if (!_index.count(w)) {
      pode = false;
      continue;
    }
    n_ind = _index[w];
    if (_index2[n_ind] >= todos[n_ind].size()) pode = false;
    if (pode) {
      p = todos[n_ind][_index2[n_ind]];
      if (p.first != 0 && p.second != 0) {
        if (!used[make_pair(p.first - 1, p.second - 1)] ||
            !used[make_pair(p.first, p.second - 1)] ||
            !used[make_pair(p.first - 1, p.second)])
          pode = false;
      } else if (p.first == 0 && p.second != 0) {
        if (!used[make_pair(p.first, p.second - 1)]) pode = false;
      } else if (p.second == 0 && p.first != 0) {
        if (!used[make_pair(p.first - 1, p.second)]) pode = false;
      }
      res.push_back(p);
      used[p] = true;
    }
    _index2[n_ind]++;
  }
  if (pode) {
    cout << "YES" << endl;
    for (int i = 0; i < res.size(); i++)
      cout << res[i].first << " " << res[i].second << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
