#include <bits/stdc++.h>
using namespace std;
map<int, vector<pair<int, int> > > hsh;
int ans[200005][2];
bool comp(pair<int, int> a, pair<int, int> b) {
  return (a.first + a.second) < (b.first + b.second);
}
struct node {
  int x;
  int y;
  int sum;
};
class Compare {
 public:
  bool operator()(struct node a, struct node b) { return a.sum <= b.sum; }
};
priority_queue<struct node, vector<struct node>, Compare> pq;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int x, y;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    hsh[y - x].push_back(make_pair(x, y));
  }
  map<int, vector<pair<int, int> > >::iterator it;
  for (it = hsh.begin(); it != hsh.end(); ++it) {
    sort((*it).second.begin(), (*it).second.end(), comp);
  }
  int flag = 0, p = 0, a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    int x = a[i];
    if (hsh.find(x) == hsh.end()) {
      flag = 1;
      break;
    } else {
      if (p != 0) {
        int xxx = (*hsh[x].begin()).first;
        int yyy = (*hsh[x].begin()).second;
        struct node temp2 = pq.top();
        if (xxx <= temp2.x && yyy <= temp2.y) {
          flag = 1;
          break;
        }
      }
      ans[p][0] = (*hsh[x].begin()).first;
      ans[p][1] = (*hsh[x].begin()).second;
      hsh[x].erase(hsh[x].begin());
      struct node temp;
      temp.x = ans[p][0];
      temp.y = ans[p][1];
      temp.sum = temp.x + temp.y;
      pq.push(temp);
      p++;
    }
  }
  if (flag == 0) {
    cout << "YES\n";
    for (int j = 0; j < p; j++) cout << ans[j][0] << " " << ans[j][1] << "\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
