#include <bits/stdc++.h>

using namespace std;
const int c=55;
long long n, x[c], y[c], d[c];
bool jo(int kezd) {
    long long sum=0, maxval=0, ert=abs(x[n]-x[kezd])+abs(y[n]-y[kezd]);
    sum=maxval=ert;
    for (int i=kezd; i<n; i++) {
        sum+=d[i];
        maxval=max(maxval, d[i]);
    }

    return (sum%2==0 && 2*maxval<=sum);
}
bool test=0;
long long vel() {
    long long a=rand()%1000000, b=rand()%1000000;
    return (a+b)%1000000;
}
int main()
{
    srand(time(0));
    if (!test) cin >> n >> x[n] >> y[n];
    else {
        n=50;
        x[n]=vel(), y[n]=vel();
        cout << "alap " << x[n] << " " << y[n] << "\n";
    }
    long long sum=0, maxval=0;
    d[n]=abs(x[n]+y[n]);
    for (int i=1; i<n; i++) {
        if (!test) cin >> d[i];
        else d[i]=vel();
    }
    for (int i=1; i<=n; i++) {
        //assert(f==d[i]);
        sum+=d[i];
        maxval=max(maxval, d[i]);
    }

    if (sum%2 || 2*maxval>sum) {
        cout << "NO\n";
        return 0;
    }

    for (int i=1; i<n-1; i++) {
        x[i+1]=x[i], y[i+1]=y[i];

        x[i+1]=x[i]+d[i];
        if (jo(i+1)) continue;
        x[i+1]=x[i]-d[i];
        if (jo(i+1)) continue;

        x[i+1]=x[i];
        //assert(f==d[i]);
        y[i+1]=y[i]+d[i];
        if (jo(i+1)) continue;
        y[i+1]=y[i]-d[i];
        if (jo(i+1)) continue;

        /*cout << "baj " << i << "\n";
        cout << "x " << x[n] << " " << x[i] << "\n";
        cout << "y " << y[n] << " " << y[i] << "\n";*/
        //assert(false);


        int pos=i;

        long long sx=abs(x[n]-x[pos]), sy=abs(y[n]-y[pos]), ossz=sx+sy;
        long long lep=0;
        for (int i=pos; i<n; i++) {
            lep+=d[i];
        }
        long long spec=(lep-ossz)/2;


        /*cout << "fontos " << sx << " " << sy << "\n";

        cout << "fontos " << spec << " " << d[pos] << "\n";*/
        assert(spec>=0);
        assert(spec<=d[pos]);


        bool csere=0;
        if (sx>sy) {
            csere=1;
            swap(sx, sy);

        //assert(f==d[i]);
            swap(x[pos], y[pos]), swap(x[n], y[n]);
        }


        if (spec>0) {

            if (spec+sy>=d[pos]) {

                x[pos+1]=x[pos], y[pos+1]=y[pos];

                if (x[pos]<=x[n]) {
            //assert(f==d[i]);
                    x[pos+1]-=spec;
                } else {
                    x[pos+1]+=spec;
                }

                long long rem=d[pos]-spec;
                if (y[pos]<=y[n]) {
                    y[pos+1]+=rem;
                } else {
                    y[pos+1]-=rem;
                }
            } else {
                x[pos+1]=x[pos], y[pos+1]=y[n];
                long long rem=d[pos]-sy-spec;
                if (y[pos]<=y[n]) {
                    y[pos+1]+=spec;
                } else {
                    y[pos+1]-=spec;
                }
                if (x[pos]<=x[n]) {
                    x[pos+1]+=rem;
                } else {
                    x[pos+1]-=rem;
                }
            }
        } else {
            x[pos+1]=x[n], y[pos+1]=y[pos];
            long long rem=d[pos]-sx;
            if (y[pos]<=y[n]) {
                y[pos+1]+=rem;
            } else {
                y[pos+1]-=rem;
            }

        }

        if (csere) {
            for (int i=pos; i<=n; i++) swap(x[i], y[i]);
        }

    }

    /*for (int i=1; i<n; i++) {
        cout << d[i] << " ";
    }
    cout << "\n";*/




    cout << "YES\n";

    for (int i=1; i<=n; i++) {
        cout << x[i] << " " << y[i] << "\n";
    }

    for (int i=1; i<n; i++) {
        long long f=abs(x[i+1]-x[i])+abs(y[i+1]-y[i]);
        if (f!=d[i]) {
            cout << "baj\n";
        }
        assert(f==d[i]);
    }
    return 0;
}
/*
8
84 64
98 10 82 97 47 99 67
*/