#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18;
const int INF = 1000000009;
const int MOD = 1000000007;
map<int, int> ID;
vector<vector<int> > G;
vector<int> V;
vector<pair<int, int> > points;
int nxt[100009];
bool visited[100009];
bool dfs(int src, int id) {
  visited[src] = true;
  if (id >= (int)V.size()) {
    return true;
  }
  int lev = V[id];
  for (int i = 0; i < (int)G[lev].size(); i++) {
    int v = G[lev][i];
    if (points[v].first <= points[src].first &&
        points[v].second <= points[src].second)
      continue;
    if (!visited[v]) {
      nxt[src] = v;
      if (dfs(v, id + 1)) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  G = vector<vector<int> >(n);
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    points.push_back(pair<int, int>(x, y));
  }
  for (int i = 0; i < n; i++) {
    int w;
    cin >> w;
    if (!ID.count(w)) ID[w] = i;
    V.push_back(ID[w]);
  }
  for (int i = 0; i < n; i++) {
    int val = points[i].second - points[i].first;
    if (!ID.count(val)) {
      cout << "NO" << endl;
      return 0;
    }
    G[ID[val]].push_back(i);
  }
  for (int i = 0; i < (int)G[0].size(); i++) {
    memset(visited, 0, sizeof visited);
    int v = G[0][i];
    if (dfs(v, 1)) {
      cout << "YES" << endl;
      for (int j = 0; j < n; j++) {
        cout << points[v].first << " " << points[v].second << endl;
        v = nxt[v];
      }
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
