#include <bits/stdc++.h>
using namespace std;
template <class T>
void chmin(T &t, const T &f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, const T &f) {
  if (t < f) t = f;
}
map<int, int> check;
map<pair<int, int>, int> m;
vector<pair<int, int> > v;
int l[100005], u[100005];
set<int> s[2 * 100005];
int pos = 1;
int main() {
  int n, a[100005];
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    v.push_back(make_pair(x, y));
    m[make_pair(x, y)] = i + 1;
  }
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    s[x + 100005].insert(i);
  }
  queue<pair<pair<int, int>, int> > q;
  q.push(make_pair(make_pair(0, 0), 0));
  while (!q.empty()) {
    pair<pair<int, int>, int> p = q.front();
    q.pop();
    if (!m[p.first]) continue;
    m[p.first] = 0;
    int magic = p.first.second - p.first.first;
    set<int>::iterator it = s[magic + 100005].lower_bound(p.second);
    if (it == s[magic + 100005].end()) {
      pos = 0;
    } else {
      int num = *it;
      l[num] = p.first.first;
      u[num] = p.first.second;
      q.push(make_pair(make_pair(p.first.first + 1, p.first.second), *it));
      q.push(make_pair(make_pair(p.first.first, p.first.second + 1), *it));
      s[magic + 100005].erase(it);
    }
  }
  if (!pos) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) printf("%d %d\n", l[i], u[i]);
  return 0;
}
