#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 2000 * 1000, MOD = 1000 * 1000 * 1000 + 7;
const long long INF = 1000 * 1LL * 1000000 * 1000 * 1000000;
const int N = 400000, cons = 200000;
int n, x[N], y[N], w[N], ansx[N], ansy[N];
list<pair<int, int> > vec[N];
map<int, map<int, bool> > was;
bool check(int pos) { return ((ansx[pos] + 1) * (ansy[pos] + 1)) <= pos; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    was[x[i]][y[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    cin >> w[i];
  }
  for (int i = -100000; i <= 100000; i++) {
    int X, Y;
    if (i < 0) {
      X = -i;
      Y = 0;
    } else {
      X = 0;
      Y = i;
    }
    while (1) {
      if (!was[X][Y]) {
        break;
      }
      vec[i + cons].push_back(make_pair(X, Y));
      X++;
      Y++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vec[w[i] + cons].empty()) {
      cout << "NO";
      exit(0);
    }
    list<pair<int, int> >::iterator it = vec[w[i] + cons].begin();
    ansx[i] = it->first;
    ansy[i] = it->second;
    vec[w[i] + cons].erase(it);
  }
  for (int i = 1; i <= n; i++) {
    if (!check(i)) {
      cout << "NO";
      exit(0);
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cout << ansx[i] << " " << ansy[i];
    cout << endl;
  }
  return 0;
}
