#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<pair<int, int> > a;
  int mx = 0, my = 0;
  for (__typeof(n) i = (0); i != (n); i++) {
    int x, y;
    cin >> x >> y;
    mx = max(x, mx);
    my = max(y, my);
    a.insert(make_pair(x, y));
  }
  int p[my + mx + 1];
  for (__typeof(0) i = (-mx); i != (0); i++) {
    p[mx + i] = 0;
  }
  for (__typeof(my + 1) i = (0); i != (my + 1); i++) {
    p[mx + i] = i;
  }
  vector<pair<int, int> > ans;
  for (__typeof(n) i = (0); i != (n); i++) {
    int t, d;
    cin >> t;
    if (t < -mx || t > my) {
      cout << "NO" << endl;
      return 0;
    }
    d = mx + t;
    pair<int, int> cur = make_pair(p[d] - t, p[d]);
    if (a.find(make_pair(p[d] - t - 1, p[d])) == a.end() &&
        a.find(make_pair(p[d] - t, p[d] - 1)) == a.end() &&
        a.find(cur) != a.end()) {
      ans.push_back(cur);
      a.erase(cur);
      p[d]++;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (__typeof(n) i = (0); i != (n); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
