#include <bits/stdc++.h>
using namespace std;
int binsearch(map<int, vector<int>> &hmap, int w, int i) {
  int s = 0, e = hmap[w].size() - 1, mid;
  while (s <= e) {
    mid = (s + e) / 2;
    if (hmap[w][mid] < i)
      s = mid + 1;
    else if (mid > 0 && hmap[w][mid - 1] >= i)
      e = mid - 1;
    else if (hmap[w][mid] >= i)
      return hmap[w][mid];
    else
      return -1;
  }
  return -1;
}
int main() {
  int n, i, j, x, y, w, k;
  cin >> n;
  pair<int, int> *arr = new pair<int, int>[n];
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    arr[i] = make_pair(x, y);
  }
  sort(arr, arr + n);
  map<int, vector<int>> hmap;
  for (i = 0; i < n; i++) {
    cin >> w;
    hmap[w].push_back(i);
  }
  map<pair<int, int>, int> wmap;
  map<int, pair<int, int>> rmap;
  for (j = 0; j < n; j++) {
    x = arr[j].first;
    y = arr[j].second;
    w = y - x;
    if (hmap.find(w) == hmap.end()) break;
    i = 0;
    if (x > 0) i = max(i, wmap[make_pair(x - 1, y)]);
    if (y > 0) i = max(i, wmap[make_pair(x, y - 1)]);
    k = binsearch(hmap, w, i);
    if (k == -1) break;
    wmap[arr[j]] = k;
    rmap[k] = arr[j];
  }
  if (j < n)
    cout << "NO";
  else {
    cout << "YES\n";
    for (i = 0; i < n; i++)
      cout << rmap[i].first << " " << rmap[i].second << '\n';
  }
  return 0;
}
