#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000000ll;
const int C = 100010;
int w[100100], x[100100], y[100100], k[100100];
vector<pair<int, int> > v[200200], a;
vector<int> f[100100];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++) cin >> w[i];
  for (int i = 0; i < n; i++) {
    int r = y[i] - x[i] + C;
    v[r].push_back(make_pair(x[i], y[i]));
  }
  for (int i = 0; i <= 2 * C; i++) {
    sort(v[i].begin(), v[i].end());
    reverse(v[i].begin(), v[i].end());
  }
  for (int i = 0; i < n; i++) {
    int r = w[i] + C;
    if (v[r].size() == 0) {
      cout << "NO" << endl;
      return 0;
    }
    a.push_back(v[r].back());
    v[r].pop_back();
  }
  for (int i = 0; i < n; i++) {
    k[y[i]] = max(k[y[i]], x[i]);
  }
  for (int i = 0; i <= C; i++) {
    f[i].resize(k[i] + 3);
  }
  for (int i = 0; i < n; i++) f[a[i].second][a[i].first] = i + 1;
  for (int i = 0; i <= C; i++) {
    for (int j = 0; j < f[i].size(); j++) {
      if (f[i][j] == 0) break;
      int mx = 0;
      if (j > 0) mx = f[i][j - 1];
      if (i > 0) mx = max(mx, f[i - 1][j]);
      if (mx > f[i][j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << a[i].first << ' ' << a[i].second << endl;
}
