#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

void solve(){
    int n;cin>>n;
    ll a,b;cin>>a>>b;
    n--;
    vector<array<ll,2>> ans;
    vector<ll> pref(n+1,0);
    vector<ll> dist(n+1,0);
    for(int i =1;i<=n;i++){
        cin>>dist[i];
        pref[i]=pref[i-1]+dist[i];
    }
    ans.push_back({a,b});
    int ok = 1;
    ok&= pref[n] >= a+b;
    ok&= (a+b)%2 == pref[n]%2;
    if(!ok){
        cout<<"NO\n";return;
    }
    cout<<"YES\n";

    // construction
    int cur = n;
    // pod crto
    while(b + dist[cur] < -a + pref[cur-1]){
        ans.push_back({a,b});
        ll na = a,nb= b + dist[cur];
        a=na,b=nb;
        cur--;
    }
    // binsearchamo intersection
    ll l  =0, r = dist[cur],bans = dist[cur];// bans je kok damo na b
    while(l<=r ){
        ll mid = (l+r)/2;
        ll aa = dist[cur]-mid, bb = mid;
        if(b + mid >= -(a-aa) + pref[cur-1]){
            bans=min(bans,mid);
            r=mid-1;
        }else l =mid+1;
    }
    a-=dist[cur] - bans,b+=bans;
    cur--;
    ans.push_back({a,b});
    // on the line^tm
    while(b > 0){
        if(dist[cur] <= b){
            b-=dist[cur];
            cur--;
            ans.push_back({a,b});
        }else{
            a -= dist[cur]-b;
            b=0;
            cur--;
            ans.push_back({a,b});
        }
    }
    while(a>0){
        if(dist[cur] <= a){
            a-=dist[cur];
            cur--;
            ans.push_back({a,b});
        }
    }

    //printout
    reverse(ans.begin(),ans.end());
    for(auto&[a,b]:ans) cout<<a<<" "<<b<<"\n";
}

int main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    int t=1;//cin>>t;
    while(t--) solve();
}