#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n, w[N], T[N * 4], cnt[N];
struct point {
  int x, y;
} ans[N], a[N];
vector<int> g[N];
map<int, set<int> > st;
void upd(int pos, int v = 1, int tl = 0, int tr = 1e5 + 5) {
  if (tl == tr) {
    T[v]++;
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm)
    upd(pos, v * 2, tl, tm);
  else
    upd(pos, v * 2 + 1, tm + 1, tr);
  T[v] = T[v * 2] + T[v * 2 + 1];
}
int get(int l, int r, int v = 1, int tl = 0, int tr = 1e5 + 5) {
  if (tl > r || tr < l) return 0;
  if (l <= tl && tr <= r) return T[v];
  int tm = (tl + tr) / 2;
  return get(l, r, v * 2, tl, tm) + get(l, r, v * 2 + 1, tm + 1, tr);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d", &a[i].x, &a[i].y), g[a[i].x].push_back(i);
  for (int i = 1; i <= n; i++) scanf("%d", &w[i]), st[w[i]].insert(i);
  for (int i = 0; i <= 1e5 + 5; i++) {
    for (auto it : g[i]) upd(a[it].y);
    for (auto it : g[i]) cnt[it] = get(0, a[it].y);
  }
  for (int i = 1; i <= n; i++) {
    int w = a[i].y - a[i].x;
    if (st[w].size() > 0 && *st[w].rbegin() >= cnt[i]) {
      auto it = st[w].lower_bound(cnt[i]);
      ans[*it] = a[i];
      st[w].erase(it);
      continue;
    }
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d %d\n", ans[i].x, ans[i].y);
  return 0;
}
