#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n;
map<int, set<pair<int, int> > > ms;
vector<pair<int, int> > v;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x = 0, y = 0;
    scanf("%d%d", &x, &y);
    ms[y - x].insert(make_pair(x, y));
  }
  for (int i = 0; i < n; i++) {
    int k = 0;
    scanf("%d", &k);
    if (ms[k].empty()) {
      puts("NO");
      return 0;
    }
    v.push_back(*ms[k].begin());
    ms[k].erase(ms[k].begin());
  }
  vector<int> row(maxn, -1);
  vector<int> col(maxn, -1);
  for (int i = 0; i < v.size(); i++) {
    int x = v[i].first;
    int y = v[i].second;
    if (row[x] != y - 1 || col[y] != x - 1) {
      puts("NO");
      return 0;
    }
    row[x]++;
    col[y]++;
  }
  cout << "YES" << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
