#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3fLL;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int maxn = 1e5 + 10;
int n;
map<int, set<pair<int, int> > > mp;
int w[maxn], ww[maxn], k[maxn];
vector<pair<int, int> > v;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    k[i] = y - x;
    mp[y - x].insert(make_pair(x, y));
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &w[i]);
    ww[i] = w[i];
  }
  sort(k, k + n);
  sort(w, w + n);
  for (int i = 0; i < n; i++) {
    if (w[i] != k[i]) {
      puts("NO");
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    set<pair<int, int> >::iterator it = mp[ww[i]].begin();
    v.push_back(*it);
    mp[ww[i]].erase(it);
  }
  for (int i = 1; i < n; i++) {
    if (v[i].first <= v[i - 1].first && v[i].second <= v[i - 1].second) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 0; i < n; i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
