#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  bool possible = true;
  pair<int, int> point;
  scanf("%d\n", &N);
  vector<pair<int, int> > result;
  vector<vector<pair<int, int> > > points2;
  vector<queue<pair<int, int> > > points;
  queue<pair<int, int> > q;
  vector<pair<int, int> > v;
  for (int i = 0; i < 200001; i++) {
    points.push_back(q);
    points2.push_back(v);
  }
  for (int x, y, n = 0; n < N; n++) {
    scanf("%d %d\n", &x, &y);
    points2[y - x + 100000].push_back(make_pair(x, y));
  }
  for (int i = 0; i < 200001; i++) {
    sort(points2[i].begin(), points2[i].end());
    for (int j = 0; j < points2[i].size(); j++) points[i].push(points2[i][j]);
  }
  for (int w, w1, w2, n = 0; n < N && possible; n++) {
    scanf("%d", &w);
    if (points[w + 100000].empty()) {
      possible = false;
    } else {
      point = points[w + 100000].front();
      points[w + 100000].pop();
      w1 = w + 1;
      w2 = w - 1;
      if (point.first == 0) {
        if (!points[w - 1 + 100000].empty() &&
            points[w - 1 + 100000].front().first != point.first + 1) {
          possible = false;
        }
      } else if (point.second == 0) {
        if (!points[w + 1 + 100000].empty() &&
            points[w + 1 + 100000].front().second != point.second + 1) {
          possible = false;
        }
      } else {
        if ((!points[w - 1 + 100000].empty() &&
             points[w - 1 + 100000].front().first != point.first + 1) ||
            (!points[w + 1 + 100000].empty() &&
             points[w + 1 + 100000].front().second != point.second + 1)) {
          possible = false;
        }
      }
      result.push_back(point);
    }
  }
  if (possible) {
    printf("YES\n");
    for (int i = 0; i < result.size(); i++)
      printf("%d %d\n", result[i].first, result[i].second);
  } else
    printf("NO\n");
}
