#include <bits/stdc++.h>
using namespace std;
int n, X;
int T[400010];
int t[400010];
map<int, int> mp;
map<long long, bool> ch;
vector<pair<int, int> > S;
void Take(long long a) {
  int x, y;
  if (mp[a] != 0) {
    x = mp[a];
    y = x + a;
  } else {
    if (a <= 0) {
      x = -a;
      y = 0;
    } else {
      x = 0;
      y = a;
    }
  }
  if (ch[x * 100001 + y] == 0) {
    cout << "NO";
    exit(0);
  }
  mp[a] = x + 1;
  S.push_back({x, y});
}
void Update(int v, int tl, int tr, int l, int r, int val) {
  if (tl >= r || tr <= l) return;
  if (tl >= l && tr <= r) {
    t[v] = max(t[v], val);
    T[v] = max(T[v], t[v]);
    return;
  }
  int mid = (tl + tr) / 2;
  Update(2 * v, tl, mid, l, r, val);
  Update(2 * v + 1, mid, tr, l, r, val);
  T[v] = max(T[2 * v], T[2 * v + 1]);
}
int get(int v, int tl, int tr, int l) {
  if (tl > l || tr <= l) return 0;
  if (tl == l && tr == l + 1) {
    return T[v];
  }
  int mid = (tl + tr) / 2;
  int x = get(2 * v, tl, mid, l);
  x = max(get(2 * v + 1, mid, tr, l), x);
  x = max(t[v], x);
  return x;
}
int x, y;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &x, &y);
    ch[x * 100001 + y] = 1;
    X = max(x, X);
  }
  X++;
  X++;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    Take(x);
  }
  for (int i = 0; i < n; ++i) {
    y = get(1, 1, X, S[i].first + 1);
    if (y > S[i].second) {
      cout << "NO";
      return 0;
    }
    Update(1, 1, X, 1, S[i].first + 2, S[i].second + 1);
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << S[i].first << " " << S[i].second << endl;
  return 0;
}
