#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
map<long long, pair<vector<pair<long long, long long> >, long long> > m;
pair<long long, long long> res[100010];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    m[y - x].first.push_back(make_pair(x, y));
    m[y - x].second = 0;
  }
  map<long long,
      pair<vector<pair<long long, long long> >, long long> >::iterator it =
      m.begin();
  for (it; it != m.end(); it++)
    sort(it->second.first.begin(), it->second.first.end());
  pair<long long, long long> last;
  last = make_pair(-1, -1);
  for (int i = 0; i < n; i++) {
    long long w;
    cin >> w;
    if (m[w].first.size() <= m[w].second) {
      cout << "NO" << '\n';
      return 0;
    }
    if (m[w].first[m[w].second].first <= last.first &&
        m[w].first[m[w].second].second <= last.second) {
      cout << "NO" << '\n';
      return 0;
    }
    res[i] = m[w].first[m[w].second];
    m[w].second++;
    if (res[i].first >= last.first && res[i].second >= last.second)
      last = res[i];
  }
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++)
    cout << res[i].first << " " << res[i].second << '\n';
  return 0;
}
