#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int x;
  int y;
} point;
bool compare(int a, int b) { return a < b; }
bool compare_points(point a, point b) {
  return pow(a.x, 2) + pow(a.y, 2) < pow(b.x, 2) + pow(b.y, 2);
}
int main() {
  int set_size;
  cin >> set_size;
  map<int, vector<point>*> points;
  vector<int> keys;
  for (int i = 0; i < set_size; i++) {
    point p;
    cin >> p.x >> p.y;
    int key = p.y - p.x;
    keys.push_back(key);
    if (points.find(key) == points.end()) points[key] = new vector<point>();
    points[key]->push_back(p);
  }
  vector<int> pretty;
  for (int i = 0; i < set_size; i++) {
    int next;
    cin >> next;
    if ((pretty.size() > 0 && next == pretty.back()) ||
        (abs(next) > pretty.size())) {
      cout << "NO";
      return 0;
    }
    pretty.push_back(next);
  }
  vector<int> pretty_keys = pretty;
  sort(keys.begin(), keys.end(), compare);
  sort(pretty_keys.begin(), pretty_keys.end(), compare);
  for (int i = 0; i < set_size; i++) {
    if (keys[i] != pretty_keys[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (map<int, vector<point>*>::iterator it = points.begin();
       it != points.end(); it++) {
    sort(it->second->begin(), it->second->end(), compare_points);
  }
  for (int i = 0; i < set_size; i++) {
    vector<point>* vec = points.at(pretty[i]);
    point p = vec->front();
    vec->erase(vec->begin());
    cout << p.x << " " << p.y << endl;
  }
  return 0;
}
