#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, pair<long long int, long long int> > > v;
vector<pair<long long int, long long int> > v1, v2;
vector<pair<pair<long long int, long long int>, long long int> > v3;
int main() {
  long long int n, i, j;
  cin >> n;
  for (j = 0; j < n; j++) {
    long long int x, y;
    cin >> x >> y;
    v.push_back(pair<long long int, pair<long long int, long long int> >(
        (y - x), pair<long long int, long long int>(x, y)));
  }
  sort(v.begin(), v.end());
  for (j = 0; j < n; j++) {
    long long int w;
    cin >> w;
    v1.push_back(pair<long long int, long long int>(w, j));
  }
  sort(v1.begin(), v1.end());
  v2.resize(n);
  v3.resize(n);
  for (i = 0; i < n; i++) {
    if (v[i].first != v1[i].first) {
      printf("NO\n");
      return 0;
    }
    v2[v1[i].second] = v[i].second;
    v3[i] = pair<pair<long long int, long long int>, long long int>(
        v[i].second, v1[i].second);
  }
  sort(v3.begin(), v3.end());
  int xmaxi, ymaxi;
  int ind;
  xmaxi = v3[0].first.first;
  ymaxi = v3[0].first.second;
  ind = v3[0].second;
  for (i = 1; i < n; i++) {
    if (v3[i].first.first >= xmaxi && v3[i].first.second >= ymaxi) {
      if (ind < v3[i].second) {
        xmaxi = v3[i].first.first;
        ymaxi = v3[i].first.second;
        ind = v3[i].second;
      } else {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  for (long long int i = 0; i < n; i++)
    cout << v2[i].first << " " << v2[i].second << endl;
  return 0;
}
