#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int INF = 1000001000;
const int mod = 1000 * 1000 * 1000 + 7;
const double PI = 3.1415926535897932;
double sqr(double first) { return first * first; };
long double sqr(long double first) { return first * first; };
long long sqr(long long first) { return first * first; };
long long sqr(int first) { return first * 1LL * first; };
long long gcd(long long a, long long b) {
  while (b) a %= b, swap(a, b);
  return a;
}
long long bpm(long long a, long long n = -2, long long m = mod) {
  n = n >= 0 ? n : m + n;
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * a) % m;
    a = (a * a) % m;
    n >>= 1;
  }
  return r;
}
std::ostream& operator<<(std::ostream& os, pair<int, int> p) {
  return os << "{" << p.first << " " << p.second << "}";
}
struct pr {
  int first, second;
  pr() { first = second = 0; }
  pr(int _x, int _y) : first(_x), second(_y) {}
};
bool operator<(const pr& a, const pr& b) {
  return a.first <= b.first && a.second <= b.second;
}
pr a[200000];
int main() {
  map<int, multiset<pr> > m;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int first, second;
    scanf("%d %d", &first, &second);
    ;
    m[second - first].insert(pr(first, second));
  }
  for (int i = 0; i < n; i++) {
    int w;
    scanf("%d", &w);
    if (m[w].size() == 0) {
      cout << "NO" << endl;
      return 0;
    }
    auto beg = m[w].begin();
    a[i] = *beg;
    m[w].erase(beg);
  }
  for (int i = 1; i < n; i++)
    if (a[i] < a[i - 1]) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    printf("%d ", a[i].first);
    printf("%d\n", a[i].second);
  }
  return 0;
}
