#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
  bool operator<(const node &A) const { return x > A.x; }
} ans[100005];
int x[100005], y[100005];
priority_queue<node> Q[100005 << 1];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    Q[y - x + 100005].push((node){x, y});
  }
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    if (Q[a + 100005].empty()) {
      puts("NO");
      return 0;
    }
    ans[i] = Q[a + 100005].top();
    Q[a + 100005].pop();
    if (ans[i].y != y[ans[i].x]++ || ans[i].x != x[ans[i].y]++) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d %d\n", ans[i].x, ans[i].y);
  return 0;
}
