#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > p;
pair<int, int> d[100010 << 1];
vector<pair<int, int> > ans;
int w[100010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p.insert(make_pair(x, y));
  }
  for (int i = 0; i < n; i++) scanf("%d", &w[i]);
  for (int i = 0; i < (100010 << 1); ++i) d[i] = make_pair(-1, -1);
  d[0 + 100000] = make_pair(0, 0);
  for (int i = 0; i < n; i++) {
    pair<int, int> tmp = d[w[i] + 100000];
    if (tmp == make_pair(-1, -1) || p.count(tmp) == 0) break;
    ans.push_back(tmp);
    p.erase(tmp);
    tmp.first++;
    if (p.count(tmp)) d[tmp.second - tmp.first + 100000] = tmp;
    tmp.first--, tmp.second++;
    if (p.count(tmp)) d[tmp.second - tmp.first + 100000] = tmp;
  }
  if ((int)ans.size() != n)
    puts("NO");
  else {
    puts("YES");
    for (int i = 0; i < n; i++) printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
