#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const int inf = INT_MAX;
const int nmax = 1e5 + 5;
const int cns = 1e5;
const int mod = 1e9 + 7;
using namespace std;
int n, x, y, i, w, cnt[nmax * 2], ans[nmax][2];
vector<int> v[nmax * 2];
map<int, int> mp[nmax];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) cin >> x >> y, v[y - x + cns].push_back(y);
  for (i = 0; i <= 2 * cns; i++)
    if (!v[i].empty()) sort(v[i].begin(), v[i].end());
  for (i = 1; i <= n; i++) {
    cin >> w;
    if (v[w + cns].size() <= cnt[w + cns]) return cout << "NO" << endl, 0;
    y = v[w + cns][cnt[w + cns]], cnt[w + cns]++, x = y - w, ans[i][0] = x,
    ans[i][1] = y, mp[x][y] = 1;
    if ((y > 0 && !mp[x][y - 1]) || (x > 0 && !mp[x - 1][y]))
      return cout << "NO" << endl, 0;
  }
  cout << "YES" << endl;
  for (i = 1; i <= n; i++) cout << ans[i][0] << " " << ans[i][1] << endl;
  return 0;
}
