#include <bits/stdc++.h>
using namespace std;
const int mxn = 100006;
int N;
pair<int, int> p[mxn];
map<int, deque<int> > s;
int ans[mxn];
set<pair<int, int> > v;
bool cmp(int a, int b) { return p[a] < p[b]; }
void EXEC() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%d%d", &p[i].first, &p[i].second);
    s[p[i].second - p[i].first].push_back(i);
    v.insert(p[i]);
  }
  for (map<int, deque<int> >::iterator i = s.begin(); i != s.end(); ++i)
    sort(i->second.begin(), i->second.end(), cmp);
  for (int i = 0; i < N; ++i) {
    int t;
    scanf("%d", &t);
    if (s[t].empty()) {
      printf("NO\n");
      return;
    }
    ans[i] = s[t].front();
    s[t].pop_front();
    if (v.count(make_pair(p[ans[i]].first - 1, p[ans[i]].second)) ||
        v.count(make_pair(p[ans[i]].first, p[ans[i]].second - 1))) {
      printf("NO\n");
      return;
    }
    v.erase(p[ans[i]]);
  }
  printf("YES\n");
  for (int i = 0; i < N; ++i)
    printf("%d %d\n", p[ans[i]].first, p[ans[i]].second);
}
int main() {
  EXEC();
  return 0;
}
