#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 1001001001;
int n, x, y, w;
pair<int, int> p[211111], p2[211111], ans[211111];
pair<pair<int, int>, int> Px[211111], Py[211111];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    p[i] = make_pair(y - x, x);
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &w);
    p2[i] = make_pair(w, i);
  }
  sort(p2, p2 + n);
  for (int i = 0; i < n; i++) {
    if (p[i].first == p2[i].first) {
      ans[p2[i].second] = make_pair(p[i].second, p[i].first + p[i].second);
      Px[i] = make_pair(make_pair(p[i].second, p[i].first + p[i].second),
                        p2[i].second);
      Py[i] = make_pair(make_pair(p[i].first + p[i].second, p[i].second),
                        p2[i].second);
    } else {
      cout << "NO";
      return 0;
    }
  }
  sort(Px, Px + n);
  sort(Py, Py + n);
  for (int i = 1; i < n; i++) {
    if (Px[i].first.first == Px[i - 1].first.first &&
        Px[i].second < Px[i - 1].second) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 1; i < n; i++) {
    if (Py[i].first.first == Py[i - 1].first.first &&
        Py[i].second < Py[i - 1].second) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
