#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, i;
  while (cin >> n) {
    unordered_map<int, set<pair<int, int>>> m;
    i = n;
    while (i--) {
      cin >> x >> y;
      pair<int, int> p = make_pair(x, y);
      m[y - x].insert(p);
    }
    vector<pair<int, int>> a;
    for (i = 0; i < n; ++i) {
      cin >> x;
      if (m.find(x) != m.end()) {
        set<pair<int, int>> s = m[x];
        if (!s.empty()) {
          pair<int, int> p = *s.begin();
          a.push_back(p);
          m[x].erase(p);
        }
      }
    }
    if (a.size() == n) {
      int j = 0;
      int yx, yy;
      int xx, xy;
      yx = a[0].first;
      yy = a[0].second;
      xx = yx;
      xy = yy;
      for (j = 1; j < a.size(); ++j) {
        if (a[j].first <= yx)
          if (a[j].second <= yy)
            if (a[j].first <= xx)
              if (a[j].second <= xy) break;
        if (yy <= a[j].second) {
          yy = a[j].second;
          yx = max(yx, a[j].first);
        }
        if (xx <= a[j].first) {
          xx = a[j].first;
          xy = max(xy, a[j].second);
        }
      }
      if (j == n) {
        cout << "YES\n";
        for (auto i : a) cout << i.first << ' ' << i.second << '\n';
      } else
        cout << "NO\n";
    } else
      cout << "NO\n";
  }
}
