#include <bits/stdc++.h>
using namespace std;
struct node {
  long long val;
  node() { val = 0; }
  node(long long val) : val(val) {}
};
node tree[4 * 100000];
node combine(node a, node b) {
  node res;
  res.val = max(a.val, b.val);
  return res;
}
void range_update(long long root, long long l, long long r, long long a,
                  long long val) {
  if (l == r && l == a) {
    tree[root].val = max(val, tree[root].val);
    return;
  }
  long long m = (l + r) / 2;
  if (a <= m)
    range_update(2 * root, l, m, a, val);
  else
    range_update(2 * root + 1, m + 1, r, a, val);
  tree[root] = combine(tree[2 * root], tree[2 * root + 1]);
}
node query(long long root, long long l, long long r, long long a, long long b) {
  if (l == a && r == b) return tree[root];
  long long m = (l + r) / 2;
  if (b <= m)
    return query(2 * root, l, m, a, b);
  else if (m < a)
    return query(2 * root + 1, m + 1, r, a, b);
  else {
    node left = query(2 * root, l, m, a, m);
    node right = query(2 * root + 1, m + 1, r, m + 1, b);
    node ans = combine(left, right);
    return ans;
  }
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
};
bool cmp(const Point& a, const Point& b) {
  return a.x < b.x || (a.x == b.x && a.y <= b.y);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<Point> v(n);
  map<long long, queue<long long> > m;
  for (long long i = 0; i < n; i++) {
    cin >> v[i].x >> v[i].y;
  }
  vector<long long> w(n);
  vector<Point> ans(n);
  for (long long i = 0; i < n; i++) {
    cin >> w[i];
    m[w[i]].push(i);
  }
  sort(v.begin(), v.end(), cmp);
  bool ok = true;
  for (long long i = 0; i < n && ok; i++) {
    if (m[v[i].y - v[i].x].empty())
      ok = false;
    else if (query(1, 0, 100000 - 1, 0, v[i].y).val >
             m[v[i].y - v[i].x].front())
      ok = false;
    else {
      ans[m[v[i].y - v[i].x].front()] = v[i];
      range_update(1, 0, 100000 - 1, v[i].y, m[v[i].y - v[i].x].front());
      m[v[i].y - v[i].x].pop();
    }
  }
  if (ok) {
    cout << "YES" << '\n';
    for (long long i = 0; i < n; i++) {
      cout << ans[i].x << " " << ans[i].y << '\n';
    }
  } else
    cout << "NO" << '\n';
}
