#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
const int mod = 10000;
int n;
int num[100005];
set<pair<int, int> > jihe[200010];
set<pair<int, int> > anstemp;
vector<pair<int, int> > ans;
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) {
      int temp1, temp2;
      scanf("%d%d", &temp1, &temp2);
      pair<int, int> temp;
      temp.first = temp1;
      temp.second = temp2;
      jihe[temp2 - temp1 + 100005].insert(temp);
    }
    memset(num, 0, sizeof(num));
    for (int i = 0; i < n; i++) scanf("%d", &num[i]);
    int flag = 1;
    for (int i = 0; i < n; i++) {
      if (jihe[num[i] + 100005].size() == 0) {
        flag = 0;
        break;
      } else {
        int tempx = jihe[num[i] + 100005].begin()->first;
        int tempy = jihe[num[i] + 100005].begin()->second;
        jihe[num[i] + 100005].erase(jihe[num[i] + 100005].begin());
        if (tempx > 0 && !anstemp.count(pair<int, int>(tempx - 1, tempy))) {
          flag = 0;
          break;
        }
        if (tempy > 0 && !anstemp.count(pair<int, int>(tempx, tempy - 1))) {
          flag = 0;
          break;
        }
        anstemp.insert(pair<int, int>(tempx, tempy));
        ans.push_back(pair<int, int>(tempx, tempy));
      }
    }
    if (flag == 0)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int i = 0; i < n; i++)
        printf("%d %d\n", ans[i].first, ans[i].second);
    }
    ans.clear();
    anstemp.clear();
    for (int i = 0; i < 200005; i++) jihe[i].clear();
  }
  return 0;
}
