#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(), x.end()
#define int long long
int dst(pair<int, int> a, pair<int, int> b) {
    return max(abs(a.first-b.first), abs(a.second-b.second));
}
bool gd(pair<int, int> x, pair<int, int> a, int d1, int d2) {
    return (dst(x, {0, 0}) == d2 and dst(x, a) == d1);
}
pair<int, int> gett(pair<int, int> a, int d1, int d2) { //d2 from zero
    //cerr << a.first << ' ' << a.second << ' ' << d1 << ' ' << d2 << '\n';
    pair<int, int> p = {a.first + a.second, a.first - a.second};
    vector<int> ex = {p.first+d1, p.first-d1, d2, -d2};
    vector<int> ey = {p.second+d1, p.second-d1, d2, -d2};
    for (auto i : ex) {
        for (auto j : ey) {
            //cerr << i << ' ' << j << ' ' << dst({i, j}, p) << ' ' << dst({i, j}, {0, 0}) << '\n';
            if (gd({i, j}, p, d1, d2)) {
                //cerr << i << ' ' << j << '\n';
                int x = (i+j)/2;
                int y = (i)-x;
                //cerr << x << ' ' << y << '\n';
                return {x, y};
            }
        }
    }
    exit(179);
}
void solve() {
    vector<pair<int, int>> st = {{0, 0}};
    int n, a, b;
    cin >> n >> a >> b;
    int t = a + b;
    vector<vector<pair<int, int>>> stt(n);
    stt[0] = st;
    vector<int> arr(n-1);
    for (int i = 0; i < n-1; ++i) {
        int c;
        vector<pair<int, int>> st2;
        cin >> c;
        arr[i] = c;
        for (auto [l, r] : st) {
            pair<int, int> x1 = {max(c, l), r}, x2 = {l, min(r, c)};
            if ((x1.second - x1.first) % 2)
                x1.first++;
            if ((x2.second - x2.first) % 2)
                x2.second--;
            if (x1.second >= x1.first) {
                st2.push_back({x1.first - c, x1.second + c});
            }
            if (x2.second >= x2.first) {
                st2.push_back({c-x2.second, c+x2.second});
            }
        }
        sort(all(st2));
        st.clear();
        for (auto qt : st2) {
            if (st.empty()) {
                st.push_back(qt);
            } else {
                if (st.back().second >= qt.first) {
                    st.back().second = max(qt.second, st.back().second);
                } else {
                    st.push_back(qt);
                }
            }
        }
        stt[i+1] = st;
    }
    int ind = -1;
    int cid = 0;
    for (auto i : st) {
        if (i.first <= t and t <= i.second and t%2 == i.first%2) {
            ind = cid;
            break;
        }
        cid++;
    }
    if (ind == -1) {
        cout << "NO\n";
        return;
    }
    vector<pair<int, int>> ans;
    pair<int, int> p = {a, b};
    int nind = n-1;
    ans.push_back(p);
    while (nind != 0) {
        nind--;
        int c = arr[nind];
        int nwind = 0;
        int s = p.first + p.second;
        for (auto [l, r] : stt[nind]) {
            pair<int, int> x1 = {max(c, l), r}, x2 = {l, min(r, c)};
            if ((x1.second - x1.first) % 2)
                x1.first++;
            if ((x2.second - x2.first) % 2)
                x2.second--;
            if (x1.second >= x1.first) {
                pair<int, int> t1 = {x1.first - c, x1.second + c};
                if (t1.first <= s and s <= t1.second) {
                    int pt = min(max(x1.first, s), x1.second);
                    p = gett(p, c, pt);
                   // cout << p.first << ' ' << p.second << '\n';
                    break;
                }
            }
            if (x2.second >= x2.first) {
                pair<int, int> t1 = {c-x2.second, c+x2.second};
                if (t1.first <= s and s <= t1.second) {
                    p = gett(p, c, x2.second);
                    //cout << p.first << ' ' << p.second << '\n';

                    break;
                }
            }
            nwind++;
        }
        if (nwind == stt[nind].size()) {
            exit(57);
        }
        ans.push_back(p);
    }
    cout << "YES\n";
    reverse(all(ans));
    for (auto i : ans)
        cout << i.first << ' ' << i.second << '\n';
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);

    /*
    int x = 4e12;
    int c = 2025;
    int mx = 0;
    for (int i = 0; i < 1000000; ++i) {
        if ((mx = max(mx, solve(x - i * 1345239))) > c) {
            cout << solve(x - i * 1345239) << '\n';
            exit(1);
        }
        cerr << mx << '\n';
    }
    int prc = 0;
     */
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
}