#include <bits/stdc++.h>
using namespace std;
int SETB(int x, int i) { return x = x | (1 << i); }
bool CHECKB(int x, int i) { return (bool)(x & (1 << i)); }
struct info {
  long long x, y, idx;
  bool operator<(const info& p) const { return x < p.x; }
};
info ara[200000];
long long n, deg[200000], taken[200000], ans[200000], s[200000];
vector<info> v[200000];
map<long long, long long> mp;
pair<long long, long long> pp, p1, p2;
map<pair<long long, long long>, long long> M;
int main() {
  long long i, x;
  cin >> n;
  long long id = 0;
  for (i = 1; i <= n; i++) {
    cin >> ara[i].x >> ara[i].y;
    ara[i].idx = i;
    long long val = ara[i].y - ara[i].x;
    pp = make_pair(ara[i].x, ara[i].y);
    M[pp] = i;
    if (mp.find(val) == mp.end()) mp[val] = ++id;
  }
  for (i = 1; i <= n; i++) {
    long long val = ara[i].y - ara[i].x;
    long long u = mp[val];
    v[u].push_back(ara[i]);
  }
  for (i = 1; i <= id; i++) sort(v[i].begin(), v[i].end());
  for (i = 1; i <= n; i++) {
    p1 = make_pair(ara[i].x - 1, ara[i].y);
    p2 = make_pair(ara[i].x, ara[i].y - 1);
    if (M.find(p1) != M.end()) deg[i]++;
    if (M.find(p2) != M.end()) deg[i]++;
    if (deg[i] == 0) {
      long long val = ara[i].y - ara[i].x;
      long long u = mp[val];
      taken[u] = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (mp.find(x) == mp.end()) {
      puts("NO");
      return 0;
    }
    long long u = mp[x];
    if (taken[u] != 1) {
      puts("NO");
      return 0;
    }
    if (s[u] == v[u].size()) {
      puts("NO");
      return 0;
    }
    ans[i] = v[u][s[u]].idx;
    s[u]++;
    taken[u] = 0;
    if (mp.find(x + 1) != mp.end()) {
      u = mp[x + 1];
      if (s[u] != v[u].size()) {
        long long d = v[u][s[u]].idx;
        deg[d]--;
        if (deg[d] == 0) {
          taken[u] = 1;
        }
      }
    }
    if (mp.find(x - 1) != mp.end()) {
      u = mp[x - 1];
      if (s[u] != v[u].size()) {
        long long d = v[u][s[u]].idx;
        deg[d]--;
        if (deg[d] == 0) {
          taken[u] = 1;
        }
      }
    }
  }
  puts("YES");
  for (i = 1; i <= n; i++) {
    printf("%lld %lld\n", ara[ans[i]].x, ara[ans[i]].y);
  }
  return 0;
}
