#include <bits/stdc++.h>
using namespace std;
void bad() {
  cout << "NO" << endl;
  exit(0);
}
int main() {
  int n;
  cin >> n;
  map<int, set<int>> m;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    m[y - x].insert(x);
  }
  map<int, vector<int>> mm;
  for (int i = 0; i < n; ++i) {
    int w;
    cin >> w;
    mm[w].push_back(i);
  }
  vector<pair<int, int>> thing(n);
  for (auto&& x : mm) {
    if (m[x.first].size() != x.second.size()) {
      bad();
    }
    int i = 0;
    for (auto&& y : m[x.first]) {
      thing[x.second[i]] = make_pair(y, y + x.first);
      ++i;
    }
  }
  vector<vector<int>> thang;
  for (int i = 0; i < n; ++i) {
    auto&& t = thing[i];
    if (t.first >= thang.size()) thang.resize(t.first + 1);
    if (t.second >= thang[t.first].size()) thang[t.first].resize(t.second + 1);
    thang[t.first][t.second] = i;
  }
  for (int i = 0; i < thang.size(); ++i) {
    for (int j = 0; j < thang[i].size(); ++j) {
      if (j + 1 < thang[i].size() && thang[i][j] > thang[i][j + 1]) bad();
      if (i + 1 < thang.size() && j < thang[i + 1].size() &&
          thang[i][j] > thang[i + 1][j])
        bad();
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    cout << thing[i].first << ' ' << thing[i].second << endl;
  }
}
