#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> ii; typedef vector<ll> vi; typedef vector<ii> vii; typedef vector<vi> vvi; #define x first #define y second #define pb push_back #define eb emplace_back #define rep(i,a,b) for(auto i = (a); i < (b); ++i) #define REP(i,n) rep(i,0,n) #define sz(v) ((int) (v).size()) #define rs resize #define all(v) begin(v), end(v) ll n, a, b; vi d; void print(ll dx, ll dy){ ll nu, som = 0; cout << "YES" << endl << "0 0" <<endl; for(nu = 0; nu < n && som + d[nu] <= dx; nu++){ som += d[nu]; cout << (-som)<<" 0" <<endl; } for(; nu < n && som + d[nu] <= b + dy + dx; nu++){ som += d[nu]; cout << (-dx)<< " " << (som - dx) << endl; } for(; nu < n && som + d[nu] <= a + b + 2 * dx + dy; nu++){ som += d[nu]; cout << (som - b - dy - 2 * dx) << " " << (b + dy)<< endl; } for(; nu < n; nu++){ som += d[nu]; cout << a << " " << (a + 2 * b + 2 * dx + 2 * dy - som) << endl; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(20); cin >> n; n--; cin >> a >> b; d = vi(n); for(ll i = 0; i < n; i++) cin >> d[i]; //Bepaal het verschil ll e = 0; for(ll i = 0; i < n; i++) e += d[i]; e = e - a - b; if(e < 0 || e % 2 != 0){ cout << "NO" << endl; return 0; } //Bepaal de overgang ll o, som = 0; for(o = 0; o < n; o++){ som += d[o]; if(som >= e / 2) break; } if(som <= e / 2 + b)//Nu hebben we het eerste geval { print(e/2,0); return 0; } if(som <= e / 2 + a + b)//Nu gaan we boven langs { print(0,e/2); return 0; } //Controleer de driehoeksongelijkheid if(d[o] > a + b + e / 2){ cout << "NO" <<endl; return 0; } //Handel het laatste geval af ll dx = (som - d[o]); ll dy = e / 2 - dx; print(dx,dy); return 0; }