#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, int> > > v;
vector<int> b;
vector<pair<int, int> > p;
int a[100000];
int main() {
  int n, i, j, k;
  v.resize(2 * 100000 + 1);
  b.resize(2 * 100000 + 1);
  scanf("%d", &n);
  p.resize(n);
  for (k = 0; k < n; k++) {
    scanf("%d%d", &i, &j);
    v[j - i + 100000].push_back(make_pair(i, j));
  }
  for (k = 0; k < n; k++) {
    scanf("%d", &a[k]);
    b[a[k] + 100000]++;
  }
  for (k = 0; k < 2 * 100000 + 1 && v[k].size() == b[k]; k++) {
    sort(v[k].begin(), v[k].end());
    b[k] = 0;
  }
  if (k != 2 * 100000 + 1 || a[0] != 0)
    printf("NO\n");
  else {
    for (i = 0; i < n; i++) {
      k = a[i] + 100000;
      p[i] = v[k][b[k]];
      b[k]++;
    }
    for (i = 0; i < 100000 + 1; i++) b[i] = 0;
    for (i = 0; i < n; i++) {
      if (b[p[i].first] > p[i].second)
        break;
      else
        b[p[i].first] = p[i].second;
    }
    if (i != n)
      printf("NO\n");
    else {
      printf("YES\n");
      for (i = 0; i < n; i++) printf("%d %d\n", p[i].first, p[i].second);
    }
  }
  return 0;
}
