#include <bits/stdc++.h>
using namespace std;
int N;
int X[101010], Y[101010];
int W[101010];
int ret[202020], px[202020];
map<pair<int, int>, int> pt;
void solve() {
  int i, j, k, l, r, x, y, w;
  string s;
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
    pt[{X[i], Y[i]}] = i;
  }
  for (i = -100000; i < 0; i++) px[101010 + i] = -i;
  for (i = 0; i < N; i++) {
    cin >> w;
    int wp = w + 101010;
    if (pt.count({px[wp], w + px[wp]}) == 0) return (void)printf("NO\n");
    ret[i] = r = pt[{px[wp], w + px[wp]}];
    pt.erase({X[r], Y[r]});
    px[wp]++;
    if (pt.count({X[r] - 1, Y[r]}) || pt.count({X[r], Y[r] - 1}))
      return (void)printf("NO\n");
  }
  (void)printf("YES\n");
  for (i = 0; i < N; i++) (void)printf("%d %d\n", X[ret[i]], Y[ret[i]]);
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false);
  for (i = 0; i < argc - 1; i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < s.size(); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
