#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const long long INF = (1e9);
const long long N = 1e5 + 5;
long long power(long long x, long long y) {
  long long r = 1;
  x = x % M;
  while (y) {
    if (y & 1) {
      r = (r * x) % M;
    }
    x = (x * x) % M;
    y /= 2;
  }
  return r;
}
long long X[N], Y[N], A[N];
set<long long> Q[2 * N];
void solve() {
  long long n, a, b;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a >> b;
    Q[b - a + N].insert(a);
  }
  for (long long i = 1; i <= n; i++) {
    cin >> a;
    if (!Q[a + N].size()) {
      puts("NO");
      return;
    }
    X[i] = *Q[a + N].begin();
    Y[i] = a + X[i];
    Q[a + N].erase(Q[a + N].begin());
    if (i > 1 && X[i] <= X[i - 1] && Y[i] <= Y[i - 1]) {
      puts("NO");
      return;
    }
  }
  cout << "YES" << endl;
  for (long long i = 1; i <= n; i++) {
    cout << X[i] << " " << Y[i] << endl;
  }
}
int32_t main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
