#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int main() {
  int n;
  scanf("%d", &n);
  map<int, set<pair<int, int> > > mp;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    mp[y - x].insert(make_pair(x, y));
  }
  vector<pair<int, int> > p(n);
  for (int i = 0; i < n; i++) {
    int diff;
    scanf("%d", &diff);
    if (mp[diff].empty()) {
      puts("NO");
      return 0;
    }
    p[i] = *(mp[diff].begin());
    mp[diff].erase(mp[diff].begin());
  }
  for (int i = 0; i < n - 1; i++) {
    int x = p[i].first;
    int y = p[i].second;
    int xx = p[i + 1].first;
    int yy = p[i + 1].second;
    if (x >= xx && y >= yy) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 0; i < n; i++) {
    int x = p[i].first;
    int y = p[i].second;
    printf("%d %d\n", x, y);
  }
  return 0;
}
