#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int n;
set<pair<int, int> > seti, ve;
pair<int, int> ans[maxn];
map<pair<int, int>, bool> mapi;
bool check() {
  for (int i = 0; i < n; i++) {
    int a = ans[i].first, b = ans[i].second;
    mapi[pair<int, int>(a, b)] = 1;
    if (a > 0 and !mapi[pair<int, int>(a - 1, b)]) return 0;
    if (b > 0 and !mapi[pair<int, int>(a, b - 1)]) return 0;
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    seti.insert(pair<int, int>(a, b));
  }
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ve.insert(pair<int, int>(a, i));
  }
  while (!seti.empty()) {
    pair<int, int> a = *seti.begin();
    seti.erase(seti.begin());
    int xi = a.first, yi = a.second, dif = yi - xi;
    pair<int, int> id = *(ve.lower_bound(pair<int, int>(dif, 0)));
    if (id.first != dif) {
      cout << "NO\n";
      return 0;
    }
    ve.erase(id);
    ans[id.second] = pair<int, int>(xi, yi);
  }
  if (!check()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++)
    cout << ans[i].first << ' ' << ans[i].second << '\n';
}
