#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, vis[N * 2];
struct A {
  int x, y;
  bool operator<(const A& a) const { return x < a.x; }
} p[N], ele;
vector<A> v[N * 2];
vector<A> ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &p[i].x, &p[i].y);
    v[p[i].y - p[i].x + N].push_back(p[i]);
  }
  for (int i = 0; i < 2 * N; ++i)
    if (v[i].size()) {
      sort(v[i].begin(), v[i].end());
    }
  int d[N];
  for (int i = 0; i < n; ++i) {
    scanf("%d", &d[i]);
  }
  int prex = -1000000, prey = -1000000, f[N * 2] = {};
  for (int i = 0; i < n; ++i) {
    int dd = d[i] + N, x, y, fl;
    fl = f[dd];
    if (fl >= v[dd].size()) {
      puts("NO");
      return 0;
    }
    x = v[dd][fl].x;
    y = v[dd][fl].y;
    f[dd]++;
    if (x <= prex && y <= prey) {
      puts("NO");
      return 0;
    }
    ele.x = x;
    ele.y = y;
    ans.push_back(ele);
    prex = x;
    prey = y;
  }
  puts("YES");
  for (int i = 0; i < ans.size(); ++i) {
    printf("%d %d\n", ans[i].x, ans[i].y);
  }
}
