#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
const int delta = 100000;
int N;
deque<pair<int, int> > ps[200100];
int W[100100];
int mn[1001001];
int getmn(int l, int r, int a, int b, int n) {
  if (r < a || b < l) return INF;
  if (l <= a && b <= r) return mn[n];
  int m = (a + b) / 2;
  int q1 = getmn(l, r, a, m, n * 2);
  int q2 = getmn(l, r, m + 1, b, n * 2 + 1);
  return min(q1, q2);
}
int getmn(int l, int r) { return getmn(l + 1, r + 1, 1, delta + 1, 1); }
int add(int index, int val, int a, int b, int n) {
  if (index < a || b < index) return 0;
  mn[n] = min(mn[n], val);
  if (a < b) {
    int m = (a + b) / 2;
    add(index, val, a, m, n * 2);
    add(index, val, m + 1, b, n * 2 + 1);
  }
}
int add(int index, int val) { return add(index + 1, val, 1, delta + 1, 1); }
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  cin >> N;
  for (int(i) = 1; (i) <= (N); (i)++) {
    int x, y;
    cin >> x >> y;
    ps[y - x + delta].push_back(make_pair(x, y));
  }
  for (int(i) = 0; (i) < (1001001); (i)++) mn[i] = INF;
  for (int i = 0; i < 200100; i++) sort(ps[i].begin(), ps[i].end());
  vector<pair<int, int> > v;
  for (int(i) = 1; (i) <= (N); (i)++) cin >> W[i];
  for (int(i) = 1; (i) <= (N); (i)++) {
    int w = W[i];
    if (ps[w + delta].empty()) {
      cout << "NO" << '\n';
      return 0;
    }
    v.push_back(ps[w + delta].front());
    ps[w + delta].pop_front();
  }
  for (int i = int((v).size()) - 1; i >= 0; i--) {
    int x = v[i].first;
    int y = v[i].second;
    int mny = getmn(0, x);
    if (mny <= y) {
      cout << "NO" << '\n';
      return 0;
    }
    add(x, y);
  }
  cout << "YES" << '\n';
  for (int(i) = 0; (i) < (int((v).size())); (i)++)
    cout << v[i].first << ' ' << v[i].second << '\n';
}
