#include <bits/stdc++.h>
using namespace std;

#define int long long

using ll = long long;

struct Point {
    ll a, b;
    Point (ll a = 0, ll b = 0) : a(a), b(b) {}
    bool operator == (const Point &oth) const {
        return a == oth.a && b == oth.b;
    }

    void rot() {
        ll x = a, y = b;
        a = x - y;
        b = x + y;
    }
    
    void irot() {
        ll x = a, y = b;
        a = (x + y) / 2; 
        b = y - a;
    }

    void print() {
        cout << "(" << a << ", " << b <<  ")";
    }
};
struct Seg {
    Point x, y;
    bool operator == (const Seg &oth) const {
        return x == oth.x && y == oth.y;
    }
    void print() {
        cout << "(";
        x.print();
        cout << ", ";
        y.print();
        cout <<  ")";
    }
};

ll dist(Point a, Point b) {
    return abs(a.a - b.a) + abs(a.b - b.b);
}

Seg intersect(Seg s, Seg p) {
    s.x.a = max(s.x.a, p.x.a);
    s.x.b = max(s.x.b, p.x.b);
    s.y.a = min(s.y.a, p.y.a);
    s.y.b = min(s.y.b, p.y.b);
    return s;
}

bool solve(vector<int> &d, vector<Point> &ans, Point f) {
    int ds = d.back();

    if (d.size() == 1) {
        Point orig = {0, 0};
        ans.push_back(orig);
        int dx = f.a;
        int dy = f.b;
        if (max(abs(dx), abs(dy)) != d.back()) {
            return false;
        }
        // orig.print();
        // f.print();
        // cout << " " << ds << endl;
        return true;
    }

    ll sum = 0, mx = 0;
    for (int i = 0; i < d.size() - 1; ++i) {
        sum += d[i];
        mx = max(mx, 1LL * d[i]);
    }
    d.pop_back();

    ll l = sum;
    Seg pat = {Point(-l, -l), Point(l, l)};

    ll li = max(mx * 2 - sum - 1, -1ll);    
    Seg patInt = {Point(-li, -li), Point(li, li)};

    auto get_pct = [&](Seg c1) {
        Point p;
        bool ok = false;

        auto i1 = intersect(c1, pat);

        /**
         * ((16, 16), (16, 16))((-15, -15), (15, 15))((16, 16), (15, 15))
((16, 16), (16, 16))((-15, -15), (15, 15))((16, 16), (15, 15))
((16, 16), (16, 16))((-15, -15), (15, 15))((16, 16), (15, 15))
((16, 16), (16, 16))((-15, -15), (15, 15))((16, 16), (15, 15))
         */
        if (i1.x.a > i1.y.a || i1.x.b > i1.y.b) {
            return make_pair(p, ok);
        }

        if (li < 0) {
            ok = true;
            return make_pair(Point(i1.y.a, i1.y.b), ok);
        }

        auto i2 = intersect(c1, patInt);
        if (i1 == i2) {
            return make_pair(p, ok);
        }
        //c1.print();
        //pat.print();
        //i1.print();
        //i2.print();
        //cout << "\n";
        ok = true;
        if (i2.x.a > i2.y.a || i2.x.b > i2.y.b) {
            return make_pair(i1.x, ok);
        }

        if (i1.x.a == i1.y.a) {
            if (i2.x.b - 1 >= i1.x.b) {
                return make_pair(i1.x, ok);
            }
            return make_pair(i1.y, ok);
        }

        if (i2.x.a - 1 >= i1.x.a) {
            return make_pair(i1.x, ok);
        }

        return make_pair(i1.y, ok);
    };

    auto find_pct = [&]() {
        Point c1 = {f.a - ds, f.b - ds}; 
        Point c2 = {f.a - ds, f.b + ds};
        Point c3 = {f.a + ds, f.b - ds};
        Point c4 = {f.a + ds, f.b + ds};
        
        Seg up = {c1, c2};
        Seg down = {c3, c4};
        Seg left = {c1, c3};
        Seg right = {c2, c4};

        auto [pct, ok] = get_pct(up);
        if (ok) {
            return make_pair(pct, ok);            
        }
        tie(pct, ok) = get_pct(down);
        if (ok) {
            return make_pair(pct, ok);            
        }
        tie(pct, ok) = get_pct(left);
        if (ok) {
            return make_pair(pct, ok);            
        }
        tie(pct, ok) = get_pct(right);
        if (ok) {
            return make_pair(pct, ok);            
        }

        return make_pair(pct, false);
    };
 
    auto [nf, ok] = find_pct();
    //cout << l << " " << li << "\n";
    //cout << ok << " " << nf.a << " " << nf.b << "\n";
    if (!ok) {
        return false;
    }

    ans.push_back(nf);
    return solve(d, ans, nf);
}

signed main() {
    cin.tie(NULL);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    int a, b;
    cin >> a >> b;
    Point f;
    f.a = a;
    f.b = b;

    vector<int> d(n - 1);
    for (int i = 0; i < n - 1; ++i) {
        cin >> d[i];
    }

    vector<Point> ans;
    f.rot();
    ans.push_back(f);
    bool ok = solve(d, ans, f);
    if (!ok) {
        cout << "NO\n";
        return 0;
    }

    reverse(ans.begin(), ans.end());
    cout << "YES\n";
    for (auto it : ans) {
        it.irot();
        cout << it.a << " " << it.b << "\n";
    }

    return 0;
}