#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 5;
const int mod = (int)1e9 + 7;
const int logN = 18;
const int inf = 1e9;
const int N = 2e5 + 5;
int n, m, x, y, z, w[N];
int F[N];
pair<int, int> a[N];
pair<pair<int, int>, int> c[N];
vector<pair<int, int> > v[N];
int h[N];
int query(int x) {
  int ans = 0;
  for (; x > 0; x -= x & -x) ans = max(ans, F[x]);
  return ans;
}
void update(int x, int y) {
  for (; x < N; x += x & -x) F[x] = max(F[x], y);
}
bool ctr() {
  sort(c + 1, c + n + 1);
  for (int i = 1; i <= n; i++) {
    int t = query(c[i].first.second + 1);
    if (t > c[i].second) return false;
    update(c[i].first.second + 1, c[i].second);
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x, &y);
    v[y - x + 100000].push_back(make_pair(x, y));
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
    h[w[i] + 100000]++;
  }
  for (int i = 0; i <= 200000; i++)
    if (v[i].size() != h[i]) {
      cout << "NO" << '\n';
      return 0;
    } else {
      sort(v[i].begin(), v[i].end(), greater<pair<int, int> >());
    }
  for (int i = 1; i <= n; i++) {
    a[i] = v[w[i] + 100000].back();
    v[w[i] + 100000].pop_back();
    c[i] = make_pair(make_pair(a[i].first, a[i].second), i);
  }
  if (!ctr()) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) printf("%d %d\n", a[i].first, a[i].second);
  return 0;
}
