#include <bits/stdc++.h>
using namespace std;
void run() {
  int n;
  cin >> n;
  vector<pair<long long, long long> > p(n);
  map<long long, vector<pair<long long, long long> > > weights;
  map<long long, vector<long long> > m;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  sort(p.begin(), p.end());
  for (int i = 0; i < n; i++) {
    long long w = p[i].second - p[i].first;
    weights[w].push_back(p[i]);
  }
  vector<pair<long long, long long> > r;
  vector<long long> yl(n, 0), xl(n, 0);
  for (int i = 0; i < n; i++) {
    int w;
    cin >> w;
    if (weights[w].size() == 0) {
      cout << "NO\n";
      return;
    }
    pair<long long, long long> p1 = *weights[w].begin();
    weights[w].erase(weights[w].begin());
    if (p1.second == yl[p1.first] && p1.first == xl[p1.second]) {
      yl[p1.first]++;
      xl[p1.second]++;
      r.push_back(p1);
    } else {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < r.size(); i++) {
    cout << r[i].first << " " << r[i].second << "\n";
  }
}
int main() {
  cout << fixed << setprecision(16);
  run();
  return 0;
}
