#include <bits/stdc++.h>
using namespace std;
pair<int, int> w[100000];
pair<long long, long long> A[100000];
map<long long, bool> ma;
bool f(pair<int, int> i, pair<int, int> j) {
  return i.second - i.first < j.second - j.first;
}
bool fa(pair<int, int> i, pair<int, int> j) {
  return i.second + i.first < j.second + j.first;
}
bool fu(long long f, long long s) {
  if (f < 0 || s < 0) return true;
  return ma[(f << 32) + s];
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> A[i].first >> A[i].second;
  }
  for (int i = 0; i < n; ++i) {
    cin >> w[i].first;
    w[i].second = i;
  }
  sort(w, w + n);
  sort(A, A + n, fa);
  stable_sort(A, A + n, f);
  for (int i = 0; i < n; ++i) {
    if (A[i].second - A[i].first != w[i].first) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) {
    while (w[i].second != i) {
      swap(A[i], A[w[i].second]);
      swap(w[i], w[w[i].second]);
    };
  }
  for (int i = 0; i < n; ++i) {
    if (fu(A[i].first - 1, A[i].second) && fu(A[i].first, A[i].second - 1))
      ma[(A[i].first << 32) + A[i].second] = true;
    else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  for (int i = 0; i < n; ++i) cout << '\n' << A[i].first << ' ' << A[i].second;
  return 0;
}
