#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> a[100005], c[100005], d[100005], e[100005];
bool comp(pair<int, int> p, pair<int, int> q) {
  return p.first < q.first ||
         (p.first == q.first && a[p.second].first < a[q.second].first) ||
         (p.first == q.first && a[p.second].first == a[q.second].first &&
          a[p.second].second < a[q.second].second);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
    c[i] = make_pair(a[i].second - a[i].first, i);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &d[i].first);
    d[i].second = i;
  }
  sort(c + 1, c + n + 1, comp);
  sort(d + 1, d + n + 1);
  for (int i = 1; i <= n; i++)
    if (c[i].first != d[i].first) {
      printf("NO");
      return 0;
    }
  for (int i = 1; i <= n; i++) e[d[i].second] = a[c[i].second];
  for (int i = 1; i < n; i++)
    if (e[i].first >= e[i + 1].first && e[i].second >= e[i + 1].second) {
      printf("NO");
      return 0;
    }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d %d\n", e[i].first, e[i].second);
  return 0;
}
