#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int x[n], y[n];
  vector<pair<int, int> > vect, q, yy, pp;
  for (long long int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    pp.push_back(make_pair(x[i], y[i]));
  }
  sort(pp.begin(), pp.end());
  for (long long int i = 0; i < n; i++) {
    x[i] = pp[i].first;
    y[i] = pp[i].second;
    vect.push_back(make_pair(y[i] - x[i], i));
  }
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    q.push_back(make_pair(a[i], i));
  }
  sort(vect.begin(), vect.end());
  sort(q.begin(), q.end());
  for (long long int i = 0; i < n; i++) {
    if (vect[i].first == q[i].first) {
      yy.push_back(make_pair(q[i].second, vect[i].second));
    }
  }
  if (yy.size() != n) {
    cout << "NO";
  } else {
    sort(yy.begin(), yy.end());
    for (long long int i = 0; i < n - 1; i++) {
      if ((x[yy[i].second] < (x[yy[i + 1].second])) ||
          (y[yy[i].second] < y[yy[i + 1].second])) {
        continue;
      } else {
        cout << "NO";
        exit(0);
      }
    }
    cout << "YES\n";
    for (long long int i = 0; i < n; i++) {
      cout << x[yy[i].second] << " " << y[yy[i].second] << "\n";
    }
  }
  return 0;
}
