#include <bits/stdc++.h>

using namespace std;

#define int long long

const int inf = 1e14;

struct point {
    int x;
    int y;
    point() {
        x = inf;
        y = inf;
    }
    point(int _x, int _y) {
        x = _x;
        y = _y;
    }
};

struct condition {
    int a;
    int b;
    int c;
    int L;
    int R;
};

pair<int, int> unite(vector<int> d) {
    int mn = d[0], mx = d[0];
    for(int i = 1; i < d.size(); i++) {
        vector<int> v = {abs(mn - d[i]), abs(mn + d[i]), abs(mx - d[i]), abs(mx + d[i])};
        sort(v.begin(), v.end());
        mn = v[0];
        mx = v.back();
    }
    return {mn, mx};
}

point inter(condition a, condition b) {
    if(b.b - b.a * a.b / a.a == 0) {
        int L = max(a.L, b.L), R = min(a.R, b.R);
        if(L > R) {
            return point();
        }
        int x = L;
        int y = (a.c - x * a.a) / a.b;
        if(b.a * x + b.b * y == b.c) {
            return point(x, y);
        }
        return point();
    }
    int y = (b.c - b.a * a.c / a.a) / (b.b - b.a * a.b / a.a);
    int x = (a.c - a.b * y) / a.a;
    if(a.L <= x && x <= a.R && b.L <= x && x <= b.R) {
        return point(x, y);
    }
    return point();
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  vector<int> d(n - 1);
  for(int i = 0; i < n - 1; i++) {
    cin >> d[i];
  }
  pair<int, int> curr = unite(d);
  int gas = abs(a) + abs(b);
  if(curr.first > gas || gas > curr.second) {
    cout << "NO\n";
    return 0;
  }
  if(curr.first % 2 != gas % 2) {
    cout << "NO\n";
    return 0;
  }
  vector<point> ans;
  ans.push_back(point(a, b));
  for(int i = n - 2; i >= 1; i--) {
    int dist = d[i];
    d.pop_back();
    curr = unite(d);
    {
        int x = a + dist, y = b;
        int gas = abs(x) + abs(y);
        if(curr.first <= gas && gas <= curr.second && curr.first % 2 == (x + y + gas) % 2) {
            a = x;
            b = y;
            ans.push_back(point(a, b));
            continue;
        }
    }
    vector<int> tempic = {curr.first, curr.second};
    bool found = false;
    for(int d1 : tempic) {
        vector<condition> pref, nw;
        pref.push_back({1, 1, d1, 0, d1});
        pref.push_back({1, -1, d1, 0, d1});
        pref.push_back({-1, 1, d1, -d1, 0});
        pref.push_back({-1, -1, d1, -d1, 0});
        nw.push_back({1, 1, a + b + dist, a, a + dist});
        nw.push_back({1, -1, a - b + dist, a, a + dist});
        nw.push_back({-1, 1, -a + b + dist, a - dist, a});
        nw.push_back({-1, -1, -a - b + dist, a - dist, a});
        for(auto x : pref) {
            for(auto y : nw) {
                point pt = inter(x, y);
                if(pt.x == point().x && pt.y == point().y) {
                    continue;
                }
                found = true;
                a = pt.x;
                b = pt.y;
                ans.push_back(point(a, b));
                break;
            }
            if(found) {
                break;
            }
        }
        if(found) {
            break;
        }
    }
    if(!found) {
        while(true) {

        }
    }
  }
  ans.push_back(point(0, 0));
  cout << "YES\n";
  for(int i = ans.size() - 1; i >= 0; i--) {
    cout << ans[i].x << " " << ans[i].y << "\n";
  }
  return 0;
}